concision_transformer/
primitives.rs

1/*
2    Appellation: primitives <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5pub use self::consts::*;
6
7pub mod consts {
8    /// The default dimension of the model; i.e. the number of inputs
9    pub const D_MODEL: usize = 512;
10    /// The default size of the network; i.e. the number of neurons in the network
11    pub const D_NETWORK: usize = 2048;
12    /// The default dimension of the key and query vectors
13    pub const DK: usize = D_MODEL / HEADS;
14    /// The default number of attention heads
15    pub const HEADS: usize = 8;
16    /// The default number of layers used for the encoder / decoder.
17    pub const N: usize = 6;
18}
19
20pub fn outputs_from_ratio(model: usize, network: usize) -> usize {
21    network / model
22}