Skip to content

Commit 735285e

Browse files
feat(module): add inital support for MLP
1 parent db53b29 commit 735285e

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

  • try1 (OOP Approach)/rust

try1 (OOP Approach)/rust/MLP.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use lazy_static::lazy_static;
2+
use std::sync::Mutex;
3+
use rand::Rng;
4+
5+
struct Neuron {
6+
pub value: f32,
7+
pub bias: f32,
8+
pub weights: Vec<f32>,
9+
pub prevLayerNeurons_count: u8;
10+
}
11+
impl Neuron{
12+
fn new(prevLayerNeurons_count:u8)->Neuron{
13+
let mut rng = rand::rng();
14+
15+
let randRange:f32= 1.0;
16+
17+
18+
Neuron{
19+
value: 0.0,
20+
bias: rng.random.
21+
prevLayerNeurons_count,
22+
// TODO: Figure out a way to generate random values in rust
23+
24+
25+
}
26+
27+
28+
}
29+
}

0 commit comments

Comments
 (0)