-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,2 @@ | ||
//! Neuromorphic Library | ||
pub mod neural_network; | ||
pub mod stdp; | ||
|
||
use neural_network::NeuralNetwork; | ||
use stdp::STDP; | ||
|
||
/// Neuromorphic Library | ||
pub struct NeuromorphicLib { | ||
neural_network: NeuralNetwork, | ||
stdp: STDP, | ||
} | ||
|
||
impl NeuromorphicLib { | ||
/// Create a new instance of the neuromorphic library | ||
pub fn new() -> Self { | ||
NeuromorphicLib { | ||
neural_network: NeuralNetwork::new(), | ||
stdp: STDP::new(), | ||
} | ||
} | ||
|
||
/// Train the neural network using STDP | ||
pub fn train(&mut self, inputs: &Vec<f64>, targets: &Vec<f64>) { | ||
self.stdp.train(&mut self.neural_network, inputs, targets); | ||
} | ||
|
||
/// Run the neural network | ||
pub fn run(&self, inputs: &Vec<f64>) -> Vec<f64> { | ||
self.neural_network.run(inputs) | ||
} | ||
} |