def __init__(self, input_model, config): AbstractModelParser.__init__(self, input_model, config) self._layer_dict = {'DenseLayer': 'Dense', 'Conv2DLayer': 'Conv2D', 'Conv2DDNNLayer': 'Conv2D', 'MaxPool2DLayer': 'MaxPooling2D', 'Pool2DLayer': 'AveragePooling2D', 'DropoutLayer': 'Dropout', 'FlattenLayer': 'Flatten', 'BatchNormLayer': 'BatchNormalization', 'NonlinearityLayer': 'Activation', 'ConcatLayer': 'Concatenate', 'GlobalPoolLayer': 'GlobalAveragePooling2D'} self.activation_dict = {'rectify': 'relu', 'softmax': 'softmax', 'binary_tanh_unit': 'binary_tanh', 'binary_sigmoid_unit': 'binary_sigmoid', 'linear': 'linear'}
def __init__(self, input_model, config): AbstractModelParser.__init__(self, input_model, config) self._layer_dict = { 'InnerProduct': 'Dense', 'Convolution': 'Conv2D', 'MaxPooling2D': 'MaxPooling2D', 'AveragePooling2D': 'AveragePooling2D', 'ReLU': 'Activation', 'Softmax': 'Activation', 'Concat': 'Concatenate', 'LPInnerProduct': 'Dense', 'LPConvolution': 'Conv2D', 'LPAct': 'Activation' } self.activation_dict = { 'ReLU': 'relu', 'Softmax': 'softmax', 'Sigmoid': 'sigmoid', 'LPAct': 'relu' }
def initialize_attributes(self, layer=None): attributes = AbstractModelParser.initialize_attributes(self) attributes.update(layer.get_config()) return attributes