logo

Struct neuronika::nn::ModelStatus[][src]

pub struct ModelStatus { /* fields omitted */ }
Expand description

A model’s components status.

This struct should be used when you are interested in keeping track of the statuses and the parameters of the components that are part of a neural network. There are many circumstances in which this can be useful, such as when you have more than one model in a pipeline.

This struct stores all the Learnable associated to a given model and the model’s status. It is suggested to perform the registration of the layers at the model construction.

Implementations

Returns a vector of Param linked to the learnable weights associated to a neural network.

Conceptually, this method behaves similarly to .parameters() when called on the differentiable variable outputted by the network. The key difference lies in that, while the differentiable variable’s .parameters() method would return all the differentiable leaves that took part in the computation of the output, possibly also the weights of another network, ModelStatus’s .parameters() method returns only the leaves that have been associated with it at the model’s instantiation.

Usually the result of this method is passed to an optimizer.

Registers a component.

Arguments

component - layer to be registered.

Sets the status in training mode.

Sets the status in inference mode.

Trait Implementations

Returns a new ModelStatus with empty parameters and status set to train.

Sets the status to train.

Sets the status to eval.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.