IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::IgANetGeneratorImpl< real_t > Class Template Reference

IgANetGeneratorImpl. More...

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

Inheritance diagram for iganet::IgANetGeneratorImpl< real_t >:

Public Member Functions

 IgANetGeneratorImpl ()=default
 Default constructor.
 
 IgANetGeneratorImpl (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, Options< real_t > options=Options< real_t >{})
 Constructor.
 
torch::Tensor forward (torch::Tensor x)
 Forward evaluation.
 
virtual void pretty_print (std::ostream &os=Log(log::info)) const noexcept override
 
torch::serialize::InputArchive & read (torch::serialize::InputArchive &archive, const std::string &key="iganet")
 Reads the IgANet from a torch::serialize::InputArchive object.
 
torch::serialize::OutputArchive & write (torch::serialize::OutputArchive &archive, const std::string &key="iganet") const
 Writes the IgANet into a torch::serialize::OutputArchive object.
 

Private Attributes

std::vector< std::unique_ptr< iganet::ActivationFunction > > activations_
 Vector of activation functions.
 
std::vector< torch::nn::Linear > layers_
 Vector of linear layers.
 

Detailed Description

template<typename real_t>
class iganet::IgANetGeneratorImpl< real_t >

IgANetGeneratorImpl.

Note
Following the discussion of module overship here

https://pytorch.org/tutorials/advanced/cpp_frontend.html#module-ownership

we implement a generator implementation class following

https://pytorch.org/tutorials/advanced/cpp_frontend.html#the-generator-module

Constructor & Destructor Documentation

◆ IgANetGeneratorImpl() [1/2]

template<typename real_t >
iganet::IgANetGeneratorImpl< real_t >::IgANetGeneratorImpl ( )
default

Default constructor.

◆ IgANetGeneratorImpl() [2/2]

template<typename real_t >
iganet::IgANetGeneratorImpl< real_t >::IgANetGeneratorImpl ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
Options< real_t >  options = Options<real_t>{} 
)
inlineexplicit

Constructor.

Member Function Documentation

◆ forward()

template<typename real_t >
torch::Tensor iganet::IgANetGeneratorImpl< real_t >::forward ( torch::Tensor  x)
inline

Forward evaluation.

◆ pretty_print()

template<typename real_t >
virtual void iganet::IgANetGeneratorImpl< real_t >::pretty_print ( std::ostream &  os = Log(log::info)) const
inlineoverridevirtualnoexcept

◆ read()

template<typename real_t >
torch::serialize::InputArchive & iganet::IgANetGeneratorImpl< real_t >::read ( torch::serialize::InputArchive &  archive,
const std::string &  key = "iganet" 
)
inline

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

◆ write()

template<typename real_t >
torch::serialize::OutputArchive & iganet::IgANetGeneratorImpl< real_t >::write ( torch::serialize::OutputArchive &  archive,
const std::string &  key = "iganet" 
) const
inline

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

Member Data Documentation

◆ activations_

template<typename real_t >
std::vector<std::unique_ptr<iganet::ActivationFunction> > iganet::IgANetGeneratorImpl< real_t >::activations_
private

Vector of activation functions.

◆ layers_

template<typename real_t >
std::vector<torch::nn::Linear> iganet::IgANetGeneratorImpl< real_t >::layers_
private

Vector of linear layers.


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