Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Data Fields
torch::optim::LBFGS Class Reference
Inheritance diagram for torch::optim::LBFGS:
torch::optim::LossClosureOptimizer torch::optim::detail::OptimizerBase

Public Member Functions

template<typename ParameterContainer >
 LBFGS (ParameterContainer &&parameters, const LBFGSOptions &options)
 
torch::Tensor step (LossClosure closure) override
 
void save (serialize::OutputArchive &archive) const override
 Serializes the optimizer state into the given archive.
 
void load (serialize::InputArchive &archive) override
 Deserializes the optimizer state from the given archive.
 
- Public Member Functions inherited from torch::optim::detail::OptimizerBase
 OptimizerBase (std::vector< Tensor > parameters)
 Constructs the Optimizer from a vector of parameters.
 
void add_parameters (const std::vector< Tensor > &parameters)
 Adds the given vector of parameters to the optimizer's parameter list.
 
virtual void zero_grad ()
 Zeros out the gradients of all parameters.
 
const std::vector< Tensor > & parameters () const noexcept
 Provides a const reference to the parameters this optimizer holds.
 
std::vector< Tensor > & parameters () noexcept
 Provides a reference to the parameters this optimizer holds.
 
size_t size () const noexcept
 Returns the number of parameters referenced by the optimizer.
 

Data Fields

LBFGSOptions options
 
Tensor d {torch::empty({0})}
 
Tensor H_diag {torch::empty({0})}
 
Tensor prev_flat_grad {torch::empty({0})}
 
Tensor t {torch::zeros(1)}
 
Tensor prev_loss {torch::zeros(1)}
 
std::vector< Tensorro
 
std::vector< Tensoral
 
std::deque< Tensorold_dirs
 
std::deque< Tensorold_stps
 
int64_t func_evals {0}
 
int64_t state_n_iter {0}
 

Additional Inherited Members

- Public Types inherited from torch::optim::LossClosureOptimizer
using LossClosure = std::function< Tensor()>
 A loss function closure, which is expected to return the loss value.
 
- Protected Member Functions inherited from torch::optim::detail::OptimizerBase
template<typename T >
Tbuffer_at (std::vector< T > &buffers, size_t index)
 Accesses a buffer at the given index. More...
 
Tensorbuffer_at (std::vector< Tensor > &buffers, size_t index)
 Accesses a buffer at the given index, converts it to the type of the parameter at the corresponding index (a no-op if they match). More...
 
- Protected Attributes inherited from torch::optim::detail::OptimizerBase
std::vector< Tensorparameters_
 The parameters this optimizer optimizes.
 

Detailed Description

Definition at line 27 of file lbfgs.h.

Member Function Documentation

torch::Tensor torch::optim::LBFGS::step ( LossClosure  closure)
overridevirtual

comute step length

Check conditions

Implements torch::optim::LossClosureOptimizer.

Definition at line 40 of file lbfgs.cpp.


The documentation for this class was generated from the following files: