def __init__(self, layer): if not layer.is_block: raise ValueError( "Error: Convolution layer node is not in block node") self.op_name = 'Convolution' # initialize weights and input characteristics self.input_parameter = layer.arguments[0] self.weights_parameter = utilities.find_parameter_by_name( layer.parameters, 'W', 0) self.bias_parameter = utilities.find_parameter_by_name( layer.parameters, 'b', 1) # Get the hyper-parameters for the convolution. # They are on the convolution node inside this block. convolution_nodes = depth_first_search( layer.block_root, lambda x: utilities.op_name_equals(x, 'Convolution')) self.attributes = convolution_nodes[0].attributes self.convolution_method = 0 self.input_shape = self.input_parameter.shape super().__init__(layer) nodes = utilities.get_model_layers(layer.block_root) if utilities.is_softmax_activation(nodes): self.additional_layer_text = 'softmax' else: activation_type = utilities.get_cntk_activation_name(nodes) if activation_type: self.additional_layer_text = activation_type
def __init__(self, layer): if not layer.is_block: raise ValueError("Dense node is not a block node") self.op_name = 'Dense' super().__init__(layer) internalNodes = utilities.get_model_layers(self.layer.block_root) self.additional_layer_text = utilities.get_cntk_activation_name(internalNodes)