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

The ResNetModelBuilder adds the extra layers to a 'base' model for the ResNet model. More...

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

Public Types

enum  MODEL { RESNET56 , RESNET101 , RESNET152 }
 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

 ResNetModelBuilder (string strBaseDirectory, string strDataset, int nChannels, bool bSiamese, List< Tuple< int, bool > > rgIpLayers, bool bUsePool5, bool bUseDilationConv5, MODEL model, int nBatchSize=32, int nAccumBatchSize=32, List< int > rgGpuId=null, NetParameter net=null)
 The constructor. More...
 
override SolverParameter CreateSolver ()
 Create the base solver to use. More...
 
override NetParameter CreateModel (bool bDeploy=false)
 Create the training model. More...
 
override NetParameter CreateDeployModel ()
 Create the testing SSD model for the pascal dataset. More...
 
- Public Member Functions inherited from MyCaffe.model.ModelBuilder
 ModelBuilder (string strBaseDir, NetParameter net=null, SolverParameter solver=null)
 The constructor. More...
 

Protected Member Functions

override LayerParameter addExtraLayers (bool bUseBatchNorm=true, double dfLrMult=1)
 Add extra layers (for SSD with the Pascal dataset) on top of a 'base' network (e.g. VGGNet or Inception) 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 ResNetModelBuilder adds the extra layers to a 'base' model for the ResNet model.

Definition at line 15 of file ResNetModelBuilder.cs.

Member Enumeration Documentation

◆ MODEL

Defines the type of model to create.

Enumerator
RESNET56 

Specifies to create a ResNet56 model.

RESNET101 

Specifies to create a ResNet101 model.

RESNET152 

Specifies to create a ResNet152 model.

Definition at line 41 of file ResNetModelBuilder.cs.

Constructor & Destructor Documentation

◆ ResNetModelBuilder()

MyCaffe.model.ResNetModelBuilder.ResNetModelBuilder ( string  strBaseDirectory,
string  strDataset,
int  nChannels,
bool  bSiamese,
List< Tuple< int, bool > >  rgIpLayers,
bool  bUsePool5,
bool  bUseDilationConv5,
MODEL  model,
int  nBatchSize = 32,
int  nAccumBatchSize = 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.
nChannelsSpecifies the number of channels in the data set (e.g. color = 3, b/w = 1).
bSiameseSpecifies whether or not to create a Siamese network."</param> <param name="rgIpLayers">Specifies 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.</param> <param name="bUsePool5">Specifies whether or not to use the Pool layer as the last layer.</param> <param name="bUseDilationConv5">Specifies whether or not to use dilation on block 5 layers.</param> <param name="model">Specifies the type of ResNet model to create.</param> <param name="nBatchSize">Optionally, specifies the batch size (default = 32).</param> <param name="nAccumBatchSize">Optionally, specifies the accumulation batch size (default = 32).</param> <param name="rgGpuId">Optionally, specifies a set of GPU ID's to use (when null, GPU=0 is used).</param> <param name="net">Specifies the 'base' net parameter that is to be altered.

Definition at line 72 of file ResNetModelBuilder.cs.

Member Function Documentation

◆ addExtraLayers()

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

Add extra layers (for SSD with the Pascal dataset) on top of a 'base' network (e.g. VGGNet or Inception)

Parameters
bUseBatchNormOptionally, specifies whether or not to use batch normalization layers (default = true).
dfLrMultOptionally, specifies the learning rate multiplier (default = 1.0).

Implements MyCaffe.model.ModelBuilder.

Definition at line 339 of file ResNetModelBuilder.cs.

◆ CreateDeployModel()

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

Create the testing SSD model for the pascal dataset.

Implements MyCaffe.model.ModelBuilder.

Definition at line 329 of file ResNetModelBuilder.cs.

◆ CreateModel()

override NetParameter MyCaffe.model.ResNetModelBuilder.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 160 of file ResNetModelBuilder.cs.

◆ CreateSolver()

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

Create the base solver to use.

Returns
The solver parameter created is returned.

Implements MyCaffe.model.ModelBuilder.

Definition at line 126 of file ResNetModelBuilder.cs.


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