IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase > Class Template Referenceabstract

IgANet. More...

#include </home/runner/work/iganet/iganet/include/iganet.hpp>

Inheritance diagram for iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >:
iganet::utils::Serializable iganet::utils::FullQualifiedName IgANet< Optimizer, GeometryMap, Variable > poisson< Optimizer, GeometryMap, Variable >

Public Types

using Base = IgABase< GeometryMap, Variable >
 Base type.
 
using optimizer_type = Optimizer
 Type of the optimizer.
 

Public Member Functions

 IgANet (IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Default constructor.
 

Protected Attributes

IgANetGenerator< typename Base::value_typenet_
 IgANet generator.
 
Optimizer opt_
 Optimizer.
 
IgANetOptions options_
 Options.
 

Additional Inherited Members

- Private Member Functions inherited from iganet::utils::FullQualifiedName
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.
 

Detailed Description

template<typename Optimizer, typename GeometryMap, typename Variable, template< typename, typename > typename IgABase = ::iganet::IgABase>
class iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >

IgANet.

This class implements the core functionality of IgANets

Member Typedef Documentation

◆ Base

◆ optimizer_type

Type of the optimizer.

Constructor & Destructor Documentation

◆ IgANet() [1/5]

Default constructor.

◆ IgANet() [2/5]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
template<std::size_t Coeffs>
iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::IgANet ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
std::array< int64_t, Coeffs ncoeffs,
IgANetOptions  defaults = {},
iganet::Options< typename Base::value_type options = iganet::Options<typename Base::value_type>{} 
)
inline

Constructor: number of layers, activation functions, and number of spline coefficients (same for geometry map and variables)

◆ IgANet() [3/5]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
template<std::size_t... Coeffs>
iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::IgANet ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
std::tuple< std::array< int64_t, Coeffs >... >  ncoeffs,
IgANetOptions  defaults = {},
iganet::Options< typename Base::value_type options = iganet::Options<typename Base::value_type>{} 
)
inline

Constructor: number of layers, activation functions, and number of spline coefficients (same for geometry map and variables)

◆ IgANet() [4/5]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs>
iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::IgANet ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
std::array< int64_t, GeometryMapNumCoeffs geometryMapNumCoeffs,
std::array< int64_t, VariableNumCoeffs variableNumCoeffs,
IgANetOptions  defaults = {},
iganet::Options< typename Base::value_type options = iganet::Options<typename Base::value_type>{} 
)
inline

Constructor: number of layers, activation functions, and number of spline coefficients (different for geometry map and variables)

◆ IgANet() [5/5]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
template<std::size_t... GeometryMapNumCoeffs, std::size_t... VariableNumCoeffs>
iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::IgANet ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
std::tuple< std::array< int64_t, GeometryMapNumCoeffs >... >  geometryMapNumCoeffs,
std::tuple< std::array< int64_t, VariableNumCoeffs >... >  variableNumCoeffs,
IgANetOptions  defaults = {},
iganet::Options< typename Base::value_type options = iganet::Options<typename Base::value_type>{} 
)
inline

Constructor: number of layers, activation functions, and number of spline coefficients (different for geometry map and variables)

Member Function Documentation

◆ epoch()

◆ eval()

Evaluate IgANet.

◆ inputs()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
virtual torch::Tensor iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::inputs ( int64_t  epoch) const
inlinevirtual

Returns the network inputs.

In the default implementation the inputs are the controll points of the geometry and the reference spline objects. This behavior can be changed by overriding this virtual function in a derived class.

◆ load()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
void iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::load ( const std::string &  filename,
const std::string &  key = "iganet" 
)
inline

Loads the IgANet from file.

◆ loss()

◆ named_parameters()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
torch::OrderedDict< std::string, torch::Tensor > iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::named_parameters ( ) const
inlinenoexcept

Returns a constant reference to the named parameters of the IgANet object.

◆ net() [1/2]

Returns a non-constant reference to the IgANet generator.

◆ net() [2/2]

Returns a constant reference to the IgANet generator.

◆ nparameters()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
std::size_t iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::nparameters ( ) const
inlinenoexcept

Returns the total number of parameters of the IgANet object.

◆ operator!=()

Returns true if both IgANet objects are different.

◆ operator==()

Returns true if both IgANet objects are the same.

◆ opt() [1/2]

Returns a non-constant reference to the optimizer.

◆ opt() [2/2]

Returns a constant reference to the optimizer.

◆ options() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
auto & iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::options ( )
inline

Returns a non-constant reference to the options structure.

◆ options() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
const auto & iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::options ( ) const
inline

Returns a constant reference to the options structure.

◆ parameters()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
std::vector< torch::Tensor > iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::parameters ( ) const
inlinenoexcept

Returns a constant reference to the parameters of the IgANet object.

◆ pretty_print()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
virtual void iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::pretty_print ( std::ostream &  os = Log(log::info)) const
inlineoverridevirtualnoexcept

Returns a string representation of the IgANet object.

Implements iganet::utils::Serializable.

◆ read()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
torch::serialize::InputArchive & iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::read ( torch::serialize::InputArchive &  archive,
const std::string &  key = "iganet" 
)
inline

Loads the IgANet from a torch::serialize::InputArchive object.

◆ save()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
void iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::save ( const std::string &  filename,
const std::string &  key = "iganet" 
) const
inline

Saves the IgANet to file.

◆ to_json()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
virtual nlohmann::json iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::to_json ( ) const
inlineoverridevirtual

Returns the IgANet object as JSON object.

Implements iganet::utils::Serializable.

◆ train() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
virtual void iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::train ( )
inlinevirtual

Trains the IgANet.

◆ train() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
template<typename DataLoader >
void iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::train ( DataLoader loader)
inline

Trains the IgANet.

◆ write()

template<typename Optimizer , typename GeometryMap , typename Variable , template< typename, typename > typename IgABase = ::iganet::IgABase>
torch::serialize::OutputArchive & iganet::IgANet< Optimizer, GeometryMap, Variable, IgABase >::write ( torch::serialize::OutputArchive &  archive,
const std::string &  key = "iganet" 
) const
inline

Writes the IgANet into a torch::serialize::OutputArchive object.

Member Data Documentation

◆ net_

◆ opt_

Optimizer.

◆ options_


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