![]() |
IgANet
IGAnets - Isogeometric Analysis Networks
|
#include </home/runner/work/iganet/iganet/include/net/iganet.hpp>
Public Types | |
| using | Base = IgABase< Inputs, Outputs, CollPts > |
| Base type. | |
| using | optimizer_options_type = optimizer_options_type< Optimizer >::type |
| Type of the optimizer options. | |
| using | optimizer_type = Optimizer |
| Type of the optimizer. | |
| using | value_type = Base::value_type |
| Value type. | |
Public Member Functions | |
| IgANet (const IgANetOptions &defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{}) | |
| Default constructor. | |
| template<typename NumCoeffs > | |
| IgANet (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 > | |
| IgANet (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) | |
| virtual bool | epoch (int64_t)=0 |
| Initializes epoch. | |
| void | eval () |
| Evaluate IgANet. | |
| constexpr auto & | inputs () |
| Returns a non-constant reference to the tuple of input objects. | |
| constexpr const auto & | inputs () const |
| Returns a constant reference to the tuple of input objects. | |
| 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 IgANet &other) const |
| Returns true if both IgANet objects are different. | |
| bool | operator== (const IgANet &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. | |
| constexpr auto & | outputs () |
| Returns a non-constant reference to the tuple of output objects. | |
| constexpr const auto & | outputs () const |
| Returns a constant reference to the tuple of output objects. | |
| 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. | |
| void | pretty_print (std::ostream &os) 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. | |
| torch::Tensor & | register_parameter (std::string name, torch::Tensor tensor, bool requires_grad=true) |
| Registers a parameter. | |
| void | save (const std::string &filename, const std::string &key="iganet") const |
| Saves the IgANet to file. | |
| 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. | |
Protected Attributes | |
| IgANetGenerator< typename Base::value_type > | net_ |
| IgANet generator. | |
| std::unique_ptr< optimizer_type > | opt_ |
| Optimizer. | |
| IgANetOptions | options_ |
| Options. | |
Additional Inherited Members | |
Private Member Functions inherited from iganet::utils::Serializable | |
| virtual | ~Serializable ()=default |
| Destructor. | |
Private Member Functions inherited from iganet::utils::FullQualifiedName | |
| virtual | ~FullQualifiedName ()=default |
| virtual const std::string & | name () const noexcept |
| Returns the full qualified name of the object. | |
Private Attributes inherited from iganet::utils::FullQualifiedName | |
| at::optional< std::string > | name_ |
| String storing the full qualified name of the object. | |
This class implements the core functionality of IgANets
| using iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >::Base = IgABase<Inputs, Outputs, CollPts> |
Base type.
| using iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >::optimizer_options_type = optimizer_options_type<Optimizer>::type |
Type of the optimizer options.
| using iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >::optimizer_type = Optimizer |
Type of the optimizer.
| using iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >::value_type = Base::value_type |
Value type.
|
inlineexplicit |
Default constructor.
|
inline |
Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
|
inline |
Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
|
pure virtual |
Initializes epoch.
Implemented in fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, poisson< Optimizer, GeometryMap, Variable >, poisson< Optimizer, GeometryMap, Variable >, Fitting< Optimizer, GeometryMap, Variable, memory_optimized, false >, Fitting< Optimizer, GeometryMap, Variable, memory_optimized, true >, and IgANet< Optimizer, GeometryMap, Variable >.
|
inline |
Evaluate IgANet.
|
inlineconstexpr |
Returns a non-constant reference to the tuple of input objects.
|
inlineconstexpr |
Returns a constant reference to the tuple of input objects.
|
inlinevirtual |
Attaches the given tensor to the inputs.
|
inlinevirtual |
Returns the network inputs as tensor.
|
inline |
Loads the IgANet from file.
|
pure virtual |
Computes the loss function.
Implemented in fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, fitting< Optimizer, GeometryMap, Variable >, poisson< Optimizer, GeometryMap, Variable >, poisson< Optimizer, GeometryMap, Variable >, Fitting< Optimizer, GeometryMap, Variable, memory_optimized, false >, Fitting< Optimizer, GeometryMap, Variable, memory_optimized, true >, and IgANet< Optimizer, GeometryMap, Variable >.
|
inlinenoexcept |
Returns a constant reference to the named parameters of the IgANet object.
|
inline |
Returns a non-constant reference to the IgANet generator.
|
inline |
Returns a constant reference to the IgANet generator.
|
inlinenoexcept |
Returns the total number of parameters of the IgANet object.
|
inline |
Returns true if both IgANet objects are different.
|
inline |
Returns true if both IgANet objects are the same.
|
inline |
Returns a non-constant reference to the optimizer.
|
inline |
Returns a constant reference to the optimizer.
|
inline |
Returns a non-constant reference to the optimizer options.
|
inline |
Returns a constant reference to the optimizer options.
|
inline |
Resets the optimizer options.
|
inline |
Resets the optimizer options.
|
inline |
Resets the optimizer options.
|
inline |
Resets the optimizer options.
|
inline |
Resets the optimizer.
| [in] | resetOptions | Flag to indicate whether the optimizer options should be resetted |
|
inline |
Resets the optimizer.
|
inline |
Returns a non-constant reference to the options structure.
|
inline |
Returns a constant reference to the options structure.
|
inlineconstexpr |
Returns a non-constant reference to the tuple of output objects.
|
inlineconstexpr |
Returns a constant reference to the tuple of output objects.
|
inlinevirtual |
Attaches the given tensor to the outputs.
|
inlinevirtual |
Returns the network outputs as tensor.
|
inlinenoexcept |
Returns a constant reference to the parameters of the IgANet object.
|
inlineoverridevirtualnoexcept |
Returns a string representation of the IgANet object.
Implements iganet::utils::Serializable.
|
inline |
Loads the IgANet from a torch::serialize::InputArchive object.
|
inline |
Registers a parameter.
|
inline |
Saves the IgANet to file.
|
inlineoverridevirtual |
Returns the IgANet object as JSON object.
Implements iganet::utils::Serializable.
|
inlinevirtual |
Trains the IgANet.
|
inline |
Trains the IgANet.
|
inline |
Writes the IgANet into a torch::serialize::OutputArchive object.
|
protected |
IgANet generator.
|
protected |
Optimizer.
|
protected |