NetworkConfig

Trait NetworkConfig 

Source
pub trait NetworkConfig<K, V> {
    type Store: RawStore<K, V>;

    // Required methods
    fn store(&self) -> &Self::Store;
    fn store_mut(&mut self) -> &mut Self::Store;

    // Provided methods
    fn get<'a>(&'a self, key: &K) -> Option<&'a V>
       where Self::Store: 'a { ... }
    fn get_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>
       where Self::Store: 'a + RawStoreMut<K, V> { ... }
    fn hyperparam<'a>(
        &'a mut self,
        key: K,
    ) -> <Self::Store as Store<K, V>>::Entry<'a>
       where Self::Store: 'a + Store<K, V> { ... }
}
Expand description

The NetworkConfig trait defines an interface for compatible configurations within the framework, providing a layout and a key-value store to manage hyperparameters.

Required Associated Types§

Source

type Store: RawStore<K, V>

the type of key-value store used to handle the hyperparameters of the network

Required Methods§

Source

fn store(&self) -> &Self::Store

returns a reference to the key-value store

Source

fn store_mut(&mut self) -> &mut Self::Store

returns a mutable reference to the key-value store

Provided Methods§

Source

fn get<'a>(&'a self, key: &K) -> Option<&'a V>
where Self::Store: 'a,

get a reference to a value in the store by key

Source

fn get_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>
where Self::Store: 'a + RawStoreMut<K, V>,

returns a mutable reference to a value in the store by key

Source

fn hyperparam<'a>( &'a mut self, key: K, ) -> <Self::Store as Store<K, V>>::Entry<'a>
where Self::Store: 'a + Store<K, V>,

returns the entry associated with the given key

Implementors§