IgANet
IGAnets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
IgANet< Optimizer, GeometryMap, Variable > Class Template Reference
Inheritance diagram for IgANet< Optimizer, GeometryMap, Variable >:
iganet::IgANet< Optimizer, GeometryMap, Variable > iganet::IgABase< typename, typename, typename > iganet::utils::Serializable iganet::utils::FullQualifiedName

Public Member Functions

bool epoch (int64_t epoch) override
 Initializes epoch.
 
torch::Tensor loss (const torch::Tensor &outputs, int64_t epoch) override
 Computes the loss function.
 
- Public Member Functions inherited from iganet::IgANet< Optimizer, GeometryMap, Variable >
 IgANet (const IgANetOptions &defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Default constructor.
 
 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)
 
 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)
 
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.
 
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_typeoptimizer ()
 Returns a non-constant reference to the optimizer.
 
const optimizer_typeoptimizer () const
 Returns a constant reference to the optimizer.
 
optimizer_options_typeoptimizerOptions (std::size_t param_group=0)
 Returns a non-constant reference to the optimizer options.
 
const optimizer_options_typeoptimizerOptions (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.
 
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.
 

Private Types

using Base = iganet::IgANet< Optimizer, GeometryMap, Variable >
 

Private Attributes

Base::variable_collPts_type collPts_
 

Additional Inherited Members

- Public Types inherited from iganet::IgANet< Optimizer, GeometryMap, Variable >
using Base = IgABase< GeometryMap, Variable, void >
 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.
 
- Protected Attributes inherited from iganet::IgANet< Optimizer, GeometryMap, Variable >
IgANetGenerator< typename Base::value_type > net_
 IgANet generator.
 
std::unique_ptr< optimizer_typeopt_
 Optimizer.
 
IgANetOptions options_
 Options.
 

Member Typedef Documentation

◆ Base

template<typename Optimizer , typename GeometryMap , typename Variable >
using IgANet< Optimizer, GeometryMap, Variable >::Base = iganet::IgANet<Optimizer, GeometryMap, Variable>
private

Member Function Documentation

◆ epoch()

template<typename Optimizer , typename GeometryMap , typename Variable >
bool IgANet< Optimizer, GeometryMap, Variable >::epoch ( int64_t  )
inlineoverridevirtual

◆ loss()

template<typename Optimizer , typename GeometryMap , typename Variable >
torch::Tensor IgANet< Optimizer, GeometryMap, Variable >::loss ( const torch::Tensor &  ,
int64_t   
)
inlineoverridevirtual

Computes the loss function.

Implements iganet::IgANet< Optimizer, GeometryMap, Variable >.

Member Data Documentation

◆ collPts_

template<typename Optimizer , typename GeometryMap , typename Variable >
Base::variable_collPts_type IgANet< Optimizer, GeometryMap, Variable >::collPts_
private

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