#include <Convolution.hpp>
|
| | Conv2d (const conv_params_t ¶ms, const tensor &filters, const tensor &bias) |
| | Constructs a Conv2d object given parameters, filters, and bias tensors. More...
|
| |
| | Conv2d (const conv_params_t ¶ms, const std::string &filters_filename="", const std::vector< int > &filt_dims={}, const std::string &bias_filename="", const std::vector< int > &bias_dims={}, const std::string &python_home="../scripts") |
| | Constructs a Conv2d object given the filenames and sizes of the requisite tensors. Also requires convolution parameters like the other constructor. More...
|
| |
| | Conv2d (const Conv2d &other) |
| | Copy constructor, constructs a Conv2d object that is exactly a copy of the argument. More...
|
| |
| virtual | ~Conv2d ()=default |
| | Destructor - for now trivial, may need to take on some functionality. More...
|
| |
| void | add_filters (const std::string &filters_filename, const std::vector< int > &filt_dims) |
| | Read in filters from a file given here if it wasn't passed to the constructor. Overwrites current contents of this->filters. More...
|
| |
| void | add_bias (const std::string &bias_filename, const std::vector< int > &bias_dims) |
| | Read in bias from a file given here if it wasn't passed to the constructor. Overwrites current contents of this->bias. More...
|
| |
| std::vector< tensor > | forward (const std::vector< tensor > &input) |
| | Forward function, takes data and performs the Conv2d operation using the already-initialized filters and bias tensors. More...
|
| |
| std::vector< tensor > | operator() (const std::vector< tensor > &input) |
| | Forward function, takes data and performs the Conv2d operation using the already-initialized filters and bias tensors. More...
|
| |
◆ Conv2d() [1/3]
| pytorch::Conv2d::Conv2d |
( |
const conv_params_t & |
params, |
|
|
const tensor & |
filters, |
|
|
const tensor & |
bias |
|
) |
| |
|
inlineexplicit |
Constructs a Conv2d object given parameters, filters, and bias tensors.
- Parameters
-
| params | The convolution parameters like filter size, stride, and padding. |
| filters | The trained filter tensors. For those comfortable with Py_Cpp. |
| bias | The trained bias tensors. For those comfortable with Py_Cpp. |
◆ Conv2d() [2/3]
| pytorch::Conv2d::Conv2d |
( |
const conv_params_t & |
params, |
|
|
const std::string & |
filters_filename = "", |
|
|
const std::vector< int > & |
filt_dims = {}, |
|
|
const std::string & |
bias_filename = "", |
|
|
const std::vector< int > & |
bias_dims = {}, |
|
|
const std::string & |
python_home = "../scripts" |
|
) |
| |
|
inlineexplicit |
Constructs a Conv2d object given the filenames and sizes of the requisite tensors. Also requires convolution parameters like the other constructor.
- Parameters
-
| params | The convolution parameters like filter size, stride, and padding. |
| filters_filename | The file where the filters tensor is saved. Will be loaded with numpy.load(filename). |
| filt_dims | The dimensions of the filter tensor in pytorch convention - (batch, channels, h, w) |
| bias_filename | The file where the bias tensor is saved. Will be loaded with numpy.load(filename). |
| bias_dims | The dimensions of the bias tensor in pytorch convention - (batch, channels, h, w) |
| python_home | Where the utility scripts are - holds the loading script necessary to load up the tensors. |
◆ Conv2d() [3/3]
| pytorch::Conv2d::Conv2d |
( |
const Conv2d & |
other | ) |
|
|
inline |
Copy constructor, constructs a Conv2d object that is exactly a copy of the argument.
- Parameters
-
◆ ~Conv2d()
| virtual pytorch::Conv2d::~Conv2d |
( |
| ) |
|
|
virtualdefault |
Destructor - for now trivial, may need to take on some functionality.
◆ add_bias()
| void pytorch::Conv2d::add_bias |
( |
const std::string & |
bias_filename, |
|
|
const std::vector< int > & |
bias_dims |
|
) |
| |
|
inline |
Read in bias from a file given here if it wasn't passed to the constructor. Overwrites current contents of this->bias.
- Parameters
-
| bias_filename | The file where the bias tensor is saved. Will be loaded with numpy.load(filename). |
| bias_dims | The dimensions of the bias tensor in pytorch convention - (batch, channels, h, w) |
◆ add_filters()
| void pytorch::Conv2d::add_filters |
( |
const std::string & |
filters_filename, |
|
|
const std::vector< int > & |
filt_dims |
|
) |
| |
|
inline |
Read in filters from a file given here if it wasn't passed to the constructor. Overwrites current contents of this->filters.
- Parameters
-
| filters_filename | The file where the filters tensor is saved. Will be loaded with numpy.load(filename). |
| filt_dims | The dimensions of the filter tensor in pytorch convention - (batch, channels, h, w) |
◆ forward()
| std::vector<tensor> pytorch::Conv2d::forward |
( |
const std::vector< tensor > & |
input | ) |
|
|
inlinevirtual |
Forward function, takes data and performs the Conv2d operation using the already-initialized filters and bias tensors.
- Parameters
-
| input | Input data size (h_in, w_in, Cin, batch) |
- Returns
- Convolved data size (h_out, w_out, Cout, batch)
Implements pytorch::Layer.
◆ operator()()
| std::vector<tensor> pytorch::Conv2d::operator() |
( |
const std::vector< tensor > & |
input | ) |
|
|
inlinevirtual |
Forward function, takes data and performs the Conv2d operation using the already-initialized filters and bias tensors.
- Parameters
-
| input | Input data size (h_in, w_in, Cin, batch) |
- Returns
- Convolved data size (h_out, w_out, Cout, batch)
Implements pytorch::Layer.
◆ bias
| tensor pytorch::Conv2d::bias |
|
private |
◆ filters
| tensor pytorch::Conv2d::filters |
|
private |
◆ has_bias
| bool pytorch::Conv2d::has_bias = false |
|
private |
◆ params
| conv_params_t pytorch::Conv2d::params |
|
private |
◆ utils
The documentation for this class was generated from the following file: