MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.model.ResNetOctConvModelBuilder Class Reference

The ResNetOctConvModelBuilder is used to build Octave Convolution based RESNET models. More...

Inheritance diagram for MyCaffe.model.ResNetOctConvModelBuilder:
MyCaffe.model.ModelBuilder

Public Types

enum  MODEL { RESNET26 }
 Defines the type of model to create. More...
 
- Public Types inherited from MyCaffe.model.ModelBuilder
enum  SCALE_BIAS { NONE , SCALE , BIAS }
 Defines the scale bias type to use. More...
 

Public Member Functions

 ResNetOctConvModelBuilder (string strBaseDirectory, string strDataset, List< Tuple< int, bool > > rgIpLayers, MODEL model, int nBatchSize=32, List< int > rgGpuId=null, NetParameter net=null)
 The constructor. More...
 
override NetParameter CreateDeployModel ()
 Create the deploy model. More...
 
override NetParameter CreateModel (bool bDeploy=false)
 Create the training model. More...
 
override SolverParameter CreateSolver ()
 Create the base solver to use. More...
 
- Public Member Functions inherited from MyCaffe.model.ModelBuilder
 ModelBuilder (string strBaseDir, NetParameter net=null, SolverParameter solver=null)
 The constructor. More...
 

Protected Member Functions

LayerParameter addOctConvBNLayer (string strInputLayer, string strOutputLayer, int nNumOutput, int nKernelSize, int nPad, int nStride, double dfAlphaIn, double dfAlphaOut, bool bUseBias=true, string strConvPrefix="", string strConvPostfix="", string strBnPrefix="", string strBnPostfix="_bn", string strLayerPostfix="", Phase phaseExclude=Phase.NONE)
 Add octave convolution, batch-norm layers. More...
 
override LayerParameter addExtraLayers (bool bUseBatchNorm=true, double dfLrMult=1)
 Add an extra layer. More...
 
- Protected Member Functions inherited from MyCaffe.model.ModelBuilder
string getFileName (string strFile, string strSubDir)
 Returns the full path of the filename using the base directory original set when creating the ModelBuilder. More...
 
LayerParameter findLayer (string strName)
 Find a layer with a given name. More...
 
NetParameter createNet (string strName)
 Create the base network parameter for the model and set its name to the 'm_strModel' name. More...
 
LayerParameter addDataLayer (string strSource, Phase phase, int nBatchSize=32, bool bOutputLabel=true, TransformationParameter transform=null, string strName="data", bool bSiamese=false)
 Add the Data layer. More...
 
LayerParameter addAnnotatedDataLayer (string strSource, Phase phase, int nBatchSize=32, bool bOutputLabel=true, string strLabelMapFile="", SimpleDatum.ANNOTATION_TYPE anno_type=SimpleDatum.ANNOTATION_TYPE.NONE, TransformationParameter transform=null, List< BatchSampler > rgSampler=null)
 Add the Annotated Data layer. More...
 
List< LayerParametercreateMultiBoxHead (LayerParameter data, int nNumClasses, List< MultiBoxHeadInfo > rgInfo, List< float > rgPriorVariance, bool bUseObjectness=false, bool bUseBatchNorm=true, double dfLrMult=1.0, bool useScale=true, int nImageHt=0, int nImageWd=0, bool bShareLocation=true, bool bFlip=true, bool bClip=true, double dfOffset=0.5, int nKernelSize=1, int nPad=0, string strConfPostfix="", string strLocPostfix="")
 Create the multi-box head layers. More...
 
LayerParameter addConvBNLayer (string strInputLayer, string strOutputLayer, bool bUseBatchNorm, bool bUseRelU, int nNumOutput, int nKernelSize, int nPad, int nStride, double dfLrMult=1.0, int nDilation=1, SCALE_BIAS useScale=SCALE_BIAS.SCALE, string strConvPrefix="", string strConvPostfix="", string strBnPrefix="", string strBnPostfix="_bn", string strScalePrefix="", string strScalePostFix="_scale", string strBiasPrefix="", string strBiasPostfix="_bias", bool bNamedParams=false, string strLayerPostfix="", Phase phaseExclude=Phase.NONE)
 Add convolution, batch-norm layers. More...
 
LayerParameter connectAndAddLayer (string fromLayer, LayerParameter toLayer, string fromLayer2=null)
 Connect the from layer to the 'to' layer. More...
 
LayerParameter connectAndAddLayer (LayerParameter fromLayer, LayerParameter toLayer, bool bInPlace=false, bool bAdd=true, int nTopIdx=0)
 Connect the from layer to the 'to' layer. More...
 
LayerParameter connectAndAddLayer (List< LayerParameter > rgFromLayer, LayerParameter toLayer, bool bAdd=true)
 Connect the from layer to the 'to' layer. More...
 
LayerParameter createConvolution (string strName, int nNumOutput, int nKernelSize, int nPad=0, int nStride=1, int nDilation=1)
 Create a new convolution layer parameter. More...
 
LayerParameter createPooling (string strName, PoolingParameter.PoolingMethod method, int nKernelSize, int nPad=0, int nStride=1)
 Create a new pooling layer parameter. More...
 
LayerParameter addVGGBlock (LayerParameter lastLayer, int nBlockIdx, int nConvIdx, int nNumOutput, int nConvCount, bool? bNoPool, bool bDilatePool=false, int nKernelSize=3, int nPad=1, int nStride=1, int nDilation=1)
 Add a new VGG block. More...
 
LayerParameter addVGGfc (LayerParameter lastLayer, int nBlockIdx, int nConvIdx, int nNumOutput, int nDilation, bool bDilated, bool bNoPool, bool bFullConv, bool bReduced, bool bDropout)
 Adds the final layers to the network. More...
 
LayerParameter addVGGNetBody (LayerParameter lastLayer, bool bNeedFc=true, bool bFullConv=true, bool bReduced=true, bool bDilated=true, bool bNoPool=false, bool bDropout=false, List< string > rgstrFreezeLayers=null, bool bDilatePool4=false)
 Adds the full VGG body to the network, connecting it to the 'lastLayer'. More...
 
LayerParameter addResBody (LayerParameter lastLayer, string strBlockName, int nOut2A, int nOut2B, int nOut2C, int nStride, bool bUseBranch1, int nDilation=1, bool bNamedParams=false, string strLayerPostfix="", Phase phaseExclude=Phase.NONE)
 Adds a ResNet body to the network, connecting it to the 'lastLayer'. More...
 
void addExclusion (LayerParameter p, Phase phase)
 Add a phase exclusion. More...
 
LayerParameter addResNetBody (string strDataName, int nBlock3Count=4, int nBlock4Count=23, bool bUsePool5=true, bool bUseDilationConv5=false, bool bNamedParams=false, string strLayerPostfix="", Phase phaseExclude=Phase.NONE)
 Create a ResNet101 Body. More...
 

Additional Inherited Members

- Protected Attributes inherited from MyCaffe.model.ModelBuilder
string m_strBaseDir
 Specifies the base directory that contains the data and models. More...
 
NetParameter m_net = new NetParameter()
 Specifies the base net to be altered. More...
 
SolverParameter m_solver = new SolverParameter()
 Specifies the base solver to use. More...
 
- Properties inherited from MyCaffe.model.ModelBuilder
NetParameter Net [get]
 Returns the base net altered by the model builder. More...
 
SolverParameter Solver [get]
 Returns the base solver. More...
 

Detailed Description

The ResNetOctConvModelBuilder is used to build Octave Convolution based RESNET models.

See also
octconv.pytorch by d-li14 on GitHub, 2020, distributed under Apache 2.0 License https://github.com/d-li14/octconv.pytorch/blob/master/LICENSE

Definition at line 18 of file ResNetOctConvModelBuilder.cs.

Member Enumeration Documentation

◆ MODEL

Defines the type of model to create.

Enumerator
RESNET26 

Create a ResNet26 model.

Definition at line 42 of file ResNetOctConvModelBuilder.cs.

Constructor & Destructor Documentation

◆ ResNetOctConvModelBuilder()

MyCaffe.model.ResNetOctConvModelBuilder.ResNetOctConvModelBuilder ( string  strBaseDirectory,
string  strDataset,
List< Tuple< int, bool > >  rgIpLayers,
MODEL  model,
int  nBatchSize = 32,
List< int >  rgGpuId = null,
NetParameter  net = null 
)

The constructor.

Parameters
strBaseDirectorySpecifies the base directory that contains the data and models.
strDatasetSpecifies the dataset that the model will run on.
rgIpLayersSpecifies a list of inner product layers added to the end of the network where each entry specifies the number of output and whether or not Noise is enabled for the layer.
modelSpecifies the type of ResNet model to create.
nBatchSizeOptionally, specifies the batch size (default = 32).
rgGpuIdOptionally, specifies a set of GPU ID's to use (when null, GPU=0 is used).
netSpecifies the 'base' net parameter that is to be altered.

Definition at line 60 of file ResNetOctConvModelBuilder.cs.

Member Function Documentation

◆ addExtraLayers()

override LayerParameter MyCaffe.model.ResNetOctConvModelBuilder.addExtraLayers ( bool  bUseBatchNorm = true,
double  dfLrMult = 1 
)
protectedvirtual

Add an extra layer.

Parameters
bUseBatchNormNot used.
dfLrMultNot used.
Returns
Currently, just returns last layer.

Implements MyCaffe.model.ModelBuilder.

Definition at line 422 of file ResNetOctConvModelBuilder.cs.

◆ addOctConvBNLayer()

LayerParameter MyCaffe.model.ResNetOctConvModelBuilder.addOctConvBNLayer ( string  strInputLayer,
string  strOutputLayer,
int  nNumOutput,
int  nKernelSize,
int  nPad,
int  nStride,
double  dfAlphaIn,
double  dfAlphaOut,
bool  bUseBias = true,
string  strConvPrefix = "",
string  strConvPostfix = "",
string  strBnPrefix = "",
string  strBnPostfix = "_bn",
string  strLayerPostfix = "",
Phase  phaseExclude = Phase.NONE 
)
protected

Add octave convolution, batch-norm layers.

Parameters
strInputLayerSpecifies the first input layer.
strOutputLayerSpecifies the output layer.
nNumOutputSpecifies the number of output.
nKernelSizeSpecifies the kernel size.
nPadSpecifies the pad.
nStrideSpecifies the stride.
dfAlphaInSpecifies the alpha in.
dfAlphaOutSpecifies the alpha out.
bUseBiasOptionally, specifies to use bias (default = true).
strConvPrefixOptionally, specifies the convolution layer name prefix (default = "").
strConvPostfixOptionally, specifies the convolution layer name postfix (default = "").
strBnPrefixOptionally, specifies the batch-norm layer name prefix (default = "").
strBnPostfixOptionally, specifies the batch-norm layer name postfix (default = "_bn").
strLayerPostfixOptionally, specifies a layer name postfix (default = "").
phaseExcludeOptionally, specifies a phase to exclude (default = NONE).
Returns
The last layer added is returned.

Definition at line 297 of file ResNetOctConvModelBuilder.cs.

◆ CreateDeployModel()

override NetParameter MyCaffe.model.ResNetOctConvModelBuilder.CreateDeployModel ( )
virtual

Create the deploy model.

Implements MyCaffe.model.ModelBuilder.

Definition at line 104 of file ResNetOctConvModelBuilder.cs.

◆ CreateModel()

override NetParameter MyCaffe.model.ResNetOctConvModelBuilder.CreateModel ( bool  bDeploy = false)
virtual

Create the training model.

Parameters
bDeployOptionally, specifies to create a deployment model (default = false).

Implements MyCaffe.model.ModelBuilder.

Definition at line 113 of file ResNetOctConvModelBuilder.cs.

◆ CreateSolver()

override SolverParameter MyCaffe.model.ResNetOctConvModelBuilder.CreateSolver ( )
virtual

Create the base solver to use.

Returns
The solver parameter created is returned.

Implements MyCaffe.model.ModelBuilder.

Definition at line 387 of file ResNetOctConvModelBuilder.cs.


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