Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/mlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ impl MLP {
// Phase 2 implementation
}

/// Number of input features the network expects.
pub fn input_size(&self) -> usize {
self.input_size
}

/// Number of output classes the network produces.
pub fn output_size(&self) -> usize {
self.output_size
}

/// Run one training step: compute loss and gradients via `backward`,
/// apply them with `update`, and return the loss for this step.
pub fn train_step(&mut self, input: &[f32], target: &[f32], learning_rate: f32) -> f32 {
let (loss, gradients) = self.backward(input, target);
self.update(&gradients, learning_rate);
loss
}

/// Argmax: Return the index of the maximum value.
pub fn argmax(values: &[f32]) -> usize {
values
Expand Down
5 changes: 5 additions & 0 deletions src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ impl Orchestrator {
self.context.switch_project(project);
}

/// Borrow the active project name, if one is set.
pub fn current_project(&self) -> Option<&str> {
self.context.current_project()
}

/// Drop the active project's conversation history.
pub fn clear_history(&mut self) {
self.context.clear_history();
Expand Down
Loading