Struct StandardModelConfig

Source
pub struct StandardModelConfig<T> { /* private fields */ }

Implementations§

Source§

impl<T> StandardModelConfig<T>

Source

pub fn new() -> Self

Source

pub const fn batch_size(&self) -> usize

returns a copy of the batch size

Source

pub const fn batch_size_mut(&mut self) -> &mut usize

returns a mutable reference to the batch size

Source

pub const fn epochs(&self) -> usize

returns a copy of the epochs

Source

pub const fn epochs_mut(&mut self) -> &mut usize

returns a mutable reference to the epochs

Source

pub const fn hyperparameters(&self) -> &HashMap<String, T>

returns a reference to the hyperparameters map

Source

pub const fn hyperparameters_mut(&mut self) -> &mut HashMap<String, T>

returns a mutable reference to the hyperparameters map

Source

pub fn add_parameter(&mut self, key: impl ToString, value: T) -> Option<T>

inserts a hyperparameter into the map, returning the previous value if it exists

Source

pub fn get_parameter<Q>(&self, key: &Q) -> Option<&T>
where Q: ?Sized + Eq + Hash, String: Borrow<Q>,

gets a reference to a hyperparameter by key, returning None if it does not exist

Source

pub fn parameter<Q>(&mut self, key: Q) -> Entry<'_, String, T>
where Q: ToString,

returns an entry for the hyperparameter, allowing for insertion or modification

Source

pub fn remove_hyperparameter(&mut self, key: impl ToString) -> Option<T>

removes a hyperparameter from the map, returning the value if it exists

Source

pub fn set_batch_size(&mut self, batch_size: usize) -> &mut Self

sets the batch size, returning a mutable reference to the current instance

Source

pub fn set_epochs(&mut self, epochs: usize) -> &mut Self

sets the number of epochs, returning a mutable reference to the current instance

Source

pub fn with_batch_size(self, batch_size: usize) -> Self

consumes the current instance to create another with the given batch size

Source

pub fn with_epochs(self, epochs: usize) -> Self

consumes the current instance to create another with the given epochs

Source

pub fn set_decay(&mut self, decay: T) -> Option<T>

sets the decay hyperparameter, returning the previous value if it exists

Source

pub fn set_learning_rate(&mut self, learning_rate: T) -> Option<T>

Source

pub fn set_momentum(&mut self, momentum: T) -> Option<T>

sets the momentum hyperparameter, returning the previous value if it exists

Source

pub fn set_weight_decay(&mut self, decay: T) -> Option<T>

sets the weight decay hyperparameter, returning the previous value if it exists

Source

pub fn learning_rate(&self) -> Option<&T>

returns a reference to the learning rate hyperparameter, if it exists

Source

pub fn momentum(&self) -> Option<&T>

returns a reference to the momentum hyperparameter, if it exists

Source

pub fn decay(&self) -> Option<&T>

returns a reference to the decay hyperparameter, if it exists

Source

pub fn weight_decay(&self) -> Option<&T>

returns a reference to the weight decay hyperparameter, if it exists

Source§

impl<T> StandardModelConfig<T>

Source

pub fn insert_parameter(&mut self, key: impl ToString, value: T) -> Option<T>

👎Deprecated since 0.1.0: Use add_parameter instead.
Source

pub fn hyperparam<Q>(&mut self, key: Q) -> Entry<'_, String, T>
where Q: ToString,

👎Deprecated since 0.1.0: Use parameter instead.
Source

pub fn get(&self, key: impl ToString) -> Option<&T>

👎Deprecated since 0.1.0: Use get_parameter instead.

Trait Implementations§

Source§

impl<T: Clone> Clone for StandardModelConfig<T>

Source§

fn clone(&self) -> StandardModelConfig<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for StandardModelConfig<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for StandardModelConfig<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, T> Deserialize<'de> for StandardModelConfig<T>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> NetworkConfig<T> for StandardModelConfig<T>

Source§

fn get<K>(&self, key: K) -> Option<&T>
where K: AsRef<str>,

Source§

fn get_mut<K>(&mut self, key: K) -> Option<&mut T>
where K: AsRef<str>,

Source§

fn set<K>(&mut self, key: K, value: T) -> Option<T>
where K: AsRef<str>,

Source§

fn remove<K>(&mut self, key: K) -> Option<T>
where K: AsRef<str>,

Source§

fn contains<K>(&self, key: K) -> bool
where K: AsRef<str>,

Source§

fn keys(&self) -> Vec<String>

Source§

impl<T> RawConfig for StandardModelConfig<T>

Source§

type Ctx = T

Source§

impl<T> Serialize for StandardModelConfig<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> TrainingConfiguration<T> for StandardModelConfig<T>

Source§

impl<T> Send for StandardModelConfig<T>
where T: Send,

Source§

impl<T> Sync for StandardModelConfig<T>
where T: Sync,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<K, S> Identity<K> for S
where S: Borrow<K>, K: Identifier,

Source§

type Item = S

Source§

fn get(&self) -> &<S as Identity<K>>::Item

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Q> RawState for Q
where Q: Send + Sync + Debug,

Source§

fn __private__(&self) -> Seal

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,