Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jun 2, 2024
1 parent e28347c commit 4bc72ed
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/cosmic_pi_network/neuromorphic_lib/src/lib.rs
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)
}
}

0 comments on commit 4bc72ed

Please sign in to comment.