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
-
load_model
(global_conf)[source]¶ - Load prototxt and weights of Caffe, parsing them into uniform model
Parameters: global_conf ( GlobalConf
) – The global configurationsReturns: 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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
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
- caffe_parameters (
-
static