cntk.contrib.crosstalkcaffe.adapter.bvlccaffe.caffeadapter module

class CaffeAdapter[source]

Bases: cntk.contrib.crosstalkcaffe.adapter.baseadapter.Adapter

Adapt Caffe prototxt and weights into uniform format

adapt_solver()[source]
Adapt Caffe solver into CNTK format
Parameters:None
Returns:None
load_model(global_conf)[source]
Load prototxt and weights of Caffe, parsing them into uniform model
Parameters:global_conf (GlobalConf) – The global configurations
Returns:None
class SetupCaffeParameters[source]

Bases: object

Setup Caffe parameters into CNTK format

static batch_norm(caffe_parameters, inputs_info, cntk_layer_def)[source]
The batch normalization parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static convolution(caffe_parameters, inputs_info, cntk_layer_def)[source]
The convolution parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static default(caffe_parameters, inputs_info, cntk_layer_def, tensor_check=True)[source]
The default Caffe to CNTK uniform model setup
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
  • tensor_check (bool, default=True) – Whether to check the tensor shape
Returns:

None

static dense(caffe_parameters, inputs_info, cntk_layer_def)[source]
The dense parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static dropout(caffe_parameters, inputs_info, cntk_layer_def)[source]
The dropout parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static lrn(caffe_parameters, inputs_info, cntk_layer_def)[source]
The lrn parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static plus(caffe_parameters, inputs_info, cntk_layer_def)[source]
The plus parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static pooling(caffe_parameters, inputs_info, cntk_layer_def)[source]
The pooling parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static psroi_pooling(caffe_parameters, _, cntk_layer_def)[source]
The psroipooling parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static relu(caffe_parameters, inputs_info, cntk_layer_def)[source]
The ReLU parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static softmax(caffe_parameters, inputs_info, cntk_layer_def)[source]
The softmax parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None

static splice(caffe_parameters, inputs_info, cntk_layer_def)[source]
The splice parameter setup from Caffe to CNTK
Parameters:
  • caffe_parameters (caffe.Parameters) – the parameters of Caffe
  • ('class' (cntk_layer_def) – cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkTensorDefinition): The input information of current layer
  • ('class'cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition): The converted definition of CNTK layers
Returns:

None