![]() |
IgANet
IGAnets - Isogeometric Analysis Networks
|
Specialization of the abstract IgANet class for Poisson's equation. More...
Public Member Functions | |
| template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs> | |
| poisson (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const std::array< int64_t, GeometryMapNumCoeffs > &geometryMapNumCoeffs, const std::array< int64_t, VariableNumCoeffs > &variableNumCoeffs) | |
| Constructor. | |
| template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs> | |
| poisson (std::vector< int64_t > &&layers, std::vector< std::vector< std::any > > &&activations, std::array< int64_t, GeometryMapNumCoeffs > &&geometryMapNumCoeffs, std::array< int64_t, VariableNumCoeffs > &&variableNumCoeffs) | |
| Constructor. | |
| auto & | bdr () |
| Returns a non-constant reference to the boundary. | |
| auto const & | bdr () const |
| Returns a constant reference to the boundary. | |
| auto const & | collPts () const |
| Returns a constant reference to the collocation points. | |
| auto const & | collPts () const |
| Returns a constant reference to the collocation points. | |
| bool | epoch (int64_t epoch) override |
| Initializes the epoch. | |
| bool | epoch (int64_t epoch) override |
| Initializes the epoch. | |
| auto & | f () |
| Returns a non-constant reference to the right-hand side. | |
| auto const & | f () const |
| Returns a constant reference to the right-hand side. | |
| auto & | G () |
| Returns a non-constant reference to the geometry. | |
| auto const & | G () const |
| Returns a constant reference to the geometry. | |
| torch::Tensor | loss (const torch::Tensor &outputs, int64_t epoch) override |
| Computes the loss function. | |
| torch::Tensor | loss (const torch::Tensor &outputs, int64_t epoch) override |
| Computes the loss function. | |
| auto & | ref () |
| Returns a non-constant reference to the reference solution. | |
| auto & | ref () |
| Returns a non-constant reference to the reference solution. | |
| auto const & | ref () const |
| Returns a constant reference to the reference solution. | |
| auto const & | ref () const |
| Returns a constant reference to the reference solution. | |
| auto & | u () |
| Returns a non-constant reference to the solution. | |
| auto const & | u () const |
| Returns a constant reference to the solution. | |
Public Member Functions inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase > | |
| IgANet (const IgANetOptions &defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{}) | |
| Default constructor. | |
Public Member Functions inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts > | |
| 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) | |
| 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_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. | |
Private Types | |
| using | Base = iganet::v1::IgANet< Optimizer, GeometryMap, Variable > |
| Type of the base class. | |
| using | Base = iganet::IgANet< Optimizer, Inputs, Outputs > |
| Type of the base class. | |
| using | Customizable = iganet::v1::IgANetCustomizable< GeometryMap, Variable > |
| Type of the customizable class. | |
| using | Customizable = iganet::IgANetCustomizable< Inputs, Outputs > |
| Type of the customizable class. | |
Private Attributes | |
| Base::variable_collPts_type | collPts_ |
| Collocation points. | |
| Base::template collPts_t< 0 > | collPts_ |
| Collocation points. | |
| Customizable::geometryMap_interior_coeff_indices_type | G_coeff_indices_ |
| Coefficient indices of the geometry map. | |
| Customizable::template input_interior_coeff_indices_t< 0 > | G_coeff_indices_ |
| Coefficient indices of the geometry map. | |
| Customizable::geometryMap_interior_knot_indices_type | G_knot_indices_ |
| Knot indices of the geometry map. | |
| Customizable::template input_interior_knot_indices_t< 0 > | G_knot_indices_ |
| Knot indices of the geometry map. | |
| torch::Tensor | log_sigma_bdr_ |
| torch::Tensor | log_sigma_pde_ |
| Variable | ref_ |
| Reference solution. | |
| Base::template input_t< 1 > | ref_ |
| Reference solution. | |
| Customizable::variable_interior_coeff_indices_type | var_coeff_indices_ |
| Coefficient indices of variables. | |
| Customizable::template output_interior_coeff_indices_t< 0 > | var_coeff_indices_ |
| Coefficient indices of variables. | |
| Customizable::variable_interior_knot_indices_type | var_knot_indices_ |
| Knot indices of variables. | |
| Customizable::template output_interior_knot_indices_t< 0 > | var_knot_indices_ |
| Knot indices of variables. | |
Additional Inherited Members | |
Public Types inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase > | |
| using | Base = IgABase< GeometryMap, Variable > |
| Base type. | |
| using | optimizer_options_type = optimizer_options_type< Optimizer >::type |
| Type of the optimizer options. | |
| using | optimizer_type = Optimizer |
| Type of the optimizer. | |
Public Types inherited from iganet::v1::IgANetCustomizable< GeometryMap, Variable > | |
| using | geometryMap_boundary_coeff_indices_type = decltype(std::declval< GeometryMap >() .template find_coeff_indices< functionspace::boundary >(std::declval< typename GeometryMap::boundary_eval_type >())) |
| Type of the coefficient indices of geometry type at the boundary. | |
| using | geometryMap_boundary_knot_indices_type = decltype(std::declval< GeometryMap >() .template find_knot_indices< functionspace::boundary >(std::declval< typename GeometryMap::boundary_eval_type >())) |
| Type of the knot indices of the geometry map at the boundary. | |
| using | geometryMap_interior_coeff_indices_type = decltype(std::declval< GeometryMap >() .template find_coeff_indices< functionspace::interior >(std::declval< typename GeometryMap::eval_type >())) |
| Type of the coefficient indices of geometry type in the interior. | |
| using | geometryMap_interior_knot_indices_type = decltype(std::declval< GeometryMap >() .template find_knot_indices< functionspace::interior >(std::declval< typename GeometryMap::eval_type >())) |
| Type of the knot indices of the geometry map in the interior. | |
| using | variable_boundary_coeff_indices_type = decltype(std::declval< Variable >() .template find_coeff_indices< functionspace::boundary >(std::declval< typename Variable::boundary_eval_type >())) |
| Type of the coefficient indices of variable type at the boundary. | |
| using | variable_boundary_knot_indices_type = decltype(std::declval< Variable >() .template find_knot_indices< functionspace::boundary >(std::declval< typename Variable::boundary_eval_type >())) |
| Type of the knot indices of boundary_eval_type type at the boundary. | |
| using | variable_interior_coeff_indices_type = decltype(std::declval< Variable >() .template find_coeff_indices< functionspace::interior >(std::declval< typename Variable::eval_type >())) |
| Type of the coefficient indices of variable type in the interior. | |
| using | variable_interior_knot_indices_type = decltype(std::declval< Variable >() .template find_knot_indices< functionspace::interior >(std::declval< typename Variable::eval_type >())) |
| Type of the knot indices of the variables in the interior. | |
Public Types inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts > | |
| 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. | |
Protected Attributes inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase > | |
| IgANetGenerator< typename Base::value_type > | net_ |
| IgANet generator. | |
| std::unique_ptr< optimizer_type > | opt_ |
| Optimizer. | |
| IgANetOptions | options_ |
| Options. | |
Protected Attributes inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts > | |
| IgANetGenerator< typename Base::value_type > | net_ |
| IgANet generator. | |
| std::unique_ptr< optimizer_type > | opt_ |
| Optimizer. | |
| IgANetOptions | options_ |
| Options. | |
Specialization of the abstract IgANet class for Poisson's equation.
|
private |
Type of the base class.
|
private |
Type of the base class.
|
private |
Type of the customizable class.
|
private |
Type of the customizable class.
|
inline |
Constructor.
|
inline |
Constructor.
|
inline |
Returns a non-constant reference to the boundary.
|
inline |
Returns a constant reference to the boundary.
|
inline |
Returns a constant reference to the collocation points.
|
inline |
Returns a constant reference to the collocation points.
|
inlineoverridevirtual |
Initializes the epoch.
| [in] | epoch | Epoch number |
Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.
|
inlineoverridevirtual |
Initializes the epoch.
| [in] | epoch | Epoch number |
Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.
|
inline |
Returns a non-constant reference to the right-hand side.
|
inline |
Returns a constant reference to the right-hand side.
|
inline |
Returns a non-constant reference to the geometry.
|
inline |
Returns a constant reference to the geometry.
|
inlineoverridevirtual |
Computes the loss function.
| [in] | outputs | Output of the network |
| [in] | epoch | Epoch number |
Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.
|
inlineoverridevirtual |
Computes the loss function.
| [in] | outputs | Output of the network |
| [in] | epoch | Epoch number |
Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.
|
inline |
Returns a non-constant reference to the reference solution.
|
inline |
Returns a non-constant reference to the reference solution.
|
inline |
Returns a constant reference to the reference solution.
|
inline |
Returns a constant reference to the reference solution.
|
inline |
Returns a non-constant reference to the solution.
|
inline |
Returns a constant reference to the solution.
|
private |
Collocation points.
|
private |
Collocation points.
|
private |
Coefficient indices of the geometry map.
|
private |
Coefficient indices of the geometry map.
|
private |
Knot indices of the geometry map.
|
private |
Knot indices of the geometry map.
|
private |
|
private |
|
private |
Reference solution.
|
private |
Reference solution.
|
private |
Coefficient indices of variables.
|
private |
Coefficient indices of variables.
|
private |
Knot indices of variables.
|
private |
Knot indices of variables.