Coverage Control Library
Loading...
Searching...
No Matches
CNN Class Reference

Implements an architecture consisting of a multi-layer CNN followed by an MLP, according to parameters specified in the input config. More...

+ Inheritance diagram for CNN:

Public Member Functions

 __init__ (self, dict config)
 
torch.Tensor forward (self, torch.Tensor x)
 Forward pass through the network.
 
None load_cpp_model (self, str model_path)
 Loads a model saved in cpp jit format.
 
None load_model (self, str model_path)
 Loads a model saved in pytorch format.
 
- Public Member Functions inherited from CNNConfigParser
None parse (self, dict config)
 Parse the configuration for the CNN model.
 

Public Attributes

 cnn_backbone
 
 mlp
 
 latent_size
 
 linear
 
- Public Attributes inherited from CNNConfigParser
 config
 
 input_dim
 
 output_dim
 
 num_layers
 
 latent_size
 
 kernel_size
 
 image_size
 

Detailed Description

Implements an architecture consisting of a multi-layer CNN followed by an MLP, according to parameters specified in the input config.

Definition at line 38 of file cnn.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
dict config )

Reimplemented from CNNConfigParser.

Definition at line 40 of file cnn.py.

Member Function Documentation

◆ forward()

torch.Tensor forward ( self,
torch.Tensor x )

Forward pass through the network.

Parameters
xInput tensor
Returns
Output tensor

Definition at line 64 of file cnn.py.

◆ load_cpp_model()

None load_cpp_model ( self,
str model_path )

Loads a model saved in cpp jit format.

Definition at line 74 of file cnn.py.

◆ load_model()

None load_model ( self,
str model_path )

Loads a model saved in pytorch format.

Definition at line 81 of file cnn.py.

Member Data Documentation

◆ cnn_backbone

cnn_backbone

Definition at line 44 of file cnn.py.

◆ latent_size

latent_size

Definition at line 47 of file cnn.py.

◆ linear

linear

Definition at line 53 of file cnn.py.

◆ mlp

mlp

Definition at line 45 of file cnn.py.