Struct leaf::solver::Solver [] [src]

pub struct Solver<SolverB: IBackend + SolverOps<f32>, B: IBackend + LayerOps<f32>> {
    pub worker: Box<ISolver<SolverB, B>>,
    // some fields omitted
}

Solver that optimizes a Layer with a given objective.

Fields

worker

The implementation of the Solver

Methods

impl<SolverB: IBackend + SolverOps<f32> + 'static, B: IBackend + LayerOps<f32> + 'static> Solver<SolverB, B>

fn from_config(net_backend: Rc<B>, obj_backend: Rc<SolverB>, config: &SolverConfig) -> Solver<SolverB, B>

Create Solver from SolverConfig

This is the preferred method to create a Solver for training a neural network.

impl<SolverB: IBackend + SolverOps<f32> + 'static, B: IBackend + LayerOps<f32> + 'static> Solver<SolverB, B>

fn train_minibatch(&mut self, mb_data: ArcLock<SharedTensor<f32>>, mb_target: ArcLock<SharedTensor<f32>>) -> ArcLock<SharedTensor<f32>>

Train the network with one minibatch

fn network(&self) -> &Layer<B>

Returns the network trained by the solver.

This is the recommended method to get a usable trained network.

fn mut_network(&mut self) -> &mut Layer<B>

Returns the network trained by the solver.

This is the recommended method to get a trained network, if you want to alter the network. Keep in mind that altering the network might render the solver unusable and continuing training the network with it will yield unexpected results.

Trait Implementations

Derived Implementations

impl<SolverB: Debug + IBackend + SolverOps<f32>, B: Debug + IBackend + LayerOps<f32>> Debug for Solver<SolverB, B>

fn fmt(&self, __arg_0: &mut Formatter) -> Result