|
template<typename NumCoeffs > |
| IgANet2 (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const NumCoeffs &numCoeffs, enum init init=init::greville, IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{}) |
| Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
|
|
template<typename NumCoeffsInputs , typename NumCoeffsOutputs > |
| IgANet2 (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const NumCoeffsInputs &numCoeffsInputs, const NumCoeffsOutputs &numCoeffsOutputs, enum init init=init::greville, IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{}) |
| Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
|
|
| IgANet2 (IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{}) |
| Default constructor.
|
|
virtual bool | epoch (int64_t)=0 |
| Initializes epoch.
|
|
void | eval () |
| Evaluate IgANet.
|
|
virtual void | inputs (const torch::Tensor &tensor) |
| Attaches the given tensor to the inputs.
|
|
virtual torch::Tensor | inputs (int64_t epoch) const |
| Returns the network inputs as tensor.
|
|
void | load (const std::string &filename, const std::string &key="iganet") |
| Loads the IgANet from file.
|
|
virtual torch::Tensor | loss (const torch::Tensor &, int64_t)=0 |
| Computes the loss function.
|
|
torch::OrderedDict< std::string, torch::Tensor > | named_parameters () const noexcept |
| Returns a constant reference to the named parameters of the IgANet object.
|
|
IgANetGenerator< typename Base::value_type > & | net () |
| Returns a non-constant reference to the IgANet generator.
|
|
const IgANetGenerator< typename Base::value_type > & | net () const |
| Returns a constant reference to the IgANet generator.
|
|
std::size_t | nparameters () const noexcept |
| Returns the total number of parameters of the IgANet object.
|
|
bool | operator!= (const IgANet2 &other) const |
| Returns true if both IgANet objects are different.
|
|
bool | operator== (const IgANet2 &other) const |
| Returns true if both IgANet objects are the same.
|
|
optimizer_type & | optimizer () |
| Returns a non-constant reference to the optimizer.
|
|
const optimizer_type & | optimizer () const |
| Returns a constant reference to the optimizer.
|
|
optimizer_options_type & | optimizerOptions (std::size_t param_group=0) |
| Returns a non-constant reference to the optimizer options.
|
|
const optimizer_options_type & | optimizerOptions (std::size_t param_group=0) const |
| Returns a constant reference to the optimizer options.
|
|
void | optimizerOptionsReset (const optimizer_options_type &options) |
| Resets the optimizer options.
|
|
void | optimizerOptionsReset (const optimizer_options_type &options, std::size_t param_group) |
| Resets the optimizer options.
|
|
void | optimizerOptionsReset (optimizer_options_type &&options) |
| Resets the optimizer options.
|
|
void | optimizerOptionsReset (optimizer_options_type &&options, std::size_t param_group) |
| Resets the optimizer options.
|
|
void | optimizerReset (bool resetOptions=true) |
| Resets the optimizer.
|
|
void | optimizerReset (const optimizer_options_type &optimizerOptions) |
| Resets the optimizer.
|
|
auto & | options () |
| Returns a non-constant reference to the options structure.
|
|
const auto & | options () const |
| Returns a constant reference to the options structure.
|
|
virtual void | outputs (const torch::Tensor &tensor) |
| Attaches the given tensor to the outputs.
|
|
virtual torch::Tensor | outputs (int64_t epoch) const |
| Returns the network outputs as tensor.
|
|
std::vector< torch::Tensor > | parameters () const noexcept |
| Returns a constant reference to the parameters of the IgANet object.
|
|
virtual void | pretty_print (std::ostream &os=Log(log::info)) const noexcept override |
| Returns a string representation of the IgANet object.
|
|
torch::serialize::InputArchive & | read (torch::serialize::InputArchive &archive, const std::string &key="iganet") |
| Loads the IgANet from a torch::serialize::InputArchive object.
|
|
void | save (const std::string &filename, const std::string &key="iganet") const |
| Saves the IgANet to file.
|
|
virtual nlohmann::json | to_json () const override |
| Returns the IgANet object as JSON object.
|
|
virtual void | train () |
| Trains the IgANet.
|
|
template<typename DataLoader > |
void | train (DataLoader &loader) |
| Trains the IgANet.
|
|
torch::serialize::OutputArchive & | write (torch::serialize::OutputArchive &archive, const std::string &key="iganet") const |
| Writes the IgANet into a torch::serialize::OutputArchive object.
|
|
template<typename Optimizer, typename Inputs, typename Outputs, typename CollPts = void>
requires OptimizerType<Optimizer>
class iganet::IgANet2< Optimizer, Inputs, Outputs, CollPts >
IgANet2.
This class implements the core functionality of IgANets