stable_diffusion_trainer/network/
mod.rs

1//! Network module.
2
3use crate::prelude::*;
4
5/// The network structure.
6#[derive(Debug, Serialize, Deserialize)]
7pub struct Network {
8    /// The dimension of the network.
9    pub dimension: usize,
10    /// The alpha value of the network.
11    pub alpha: f32
12}
13
14impl Default for Network {
15    fn default() -> Self {
16        Network {
17            dimension: 8,
18            alpha: 1.0
19        }
20    }
21}
22
23impl Network {
24    /// Create a new network structure.
25    pub fn new() -> Self {
26        Default::default()
27    }
28
29    /// Set the dimension of the network.
30    pub fn with_dimension(mut self, dimension: usize) -> Self {
31        self.dimension = dimension;
32        self
33    }
34
35    /// Set the alpha value of the network.
36    pub fn with_alpha(mut self, alpha: f32) -> Self {
37        self.alpha = alpha;
38        self
39    }
40}