1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// use nalgebra::{DVector, dvector};
// use crate::activation_functions::ActivationFunction;
// use crate::layer::Layer;
// use crate::NeuralNetwork;
//
// struct LayerBuilder {
// neurons: usize,
// weights: Option<DVector<f64>>,
// biases: Option<DVector<f64>>,
// random: bool,
// }
//
// pub struct NeuralNetworkBuilder {
// input_layer: usize,
// output_layer: usize,
// hidden_layers: Vec<LayerBuilder>,
// activation_function: Option<ActivationFunction>,
// }
//
// impl NeuralNetworkBuilder {
// pub fn new(input_layer: usize, output_layer: usize) -> Self {
// Self {
// input_layer,
// output_layer,
// hidden_layers: Vec::new(),
// activation_function: None,
// }
// }
//
// pub fn add_layer_random(&mut self, neurons: usize) -> &mut Self {
// self.hidden_layers.push(LayerBuilder::new(neurons));
// self
// }
//
// pub fn add_layer_with_weights(&mut self, neurons: usize, weights: DVector<f64>) -> &mut Self {
// if weights.len() != neurons {
// panic!("Incompatible weights vector size");
// }
// self.hidden_layers.push(weights);
// self
// }
//
// pub fn with_activation_function(&mut self, activation_function: ActivationFunction) -> &mut Self {
// self.activation_function = Some(activation_function);
// self
// }
// }
//
// impl LayerBuilder {
// pub fn new(neurons: usize) -> Self {
// Self {
// neurons,
// weights: None,
// biases: None,
// random: true,
// }
// }
//
// pub fn with_weights(mut self, weights: DVector<f64>) -> Self {
// if weights.len() != self.neurons {
// panic!("Incompatible weights vector size");
// }
// self.weights = Some(weights);
// self.random = false;
// self
// }
//
// pub fn with_biases(mut self, biases: DVector<f64>) -> Self {
// if biases.len() != self.neurons {
// panic!("Incompatible biases vector size");
// }
// self.biases = Some(biases);
// self.random = false;
// self
// }
// }