def parse_config_cnn(self, arguments, nnet_spec, conv_nnet_spec): self.parse_config_dnn(arguments, nnet_spec) # parse convolutional layer structure self.conv_layer_configs = parse_conv_spec(conv_nnet_spec, self.batch_size) # parse convolutional layer activation # parse activation function, including maxout if arguments.has_key('conv_activation'): self.conv_activation_text = arguments['conv_activation'] self.conv_activation = parse_activation(arguments['conv_activation']) # maxout not supported yet # whether we use the fast version of convolution if arguments.has_key('use_fast'): self.use_fast = string2bool(arguments['use_fast'])
def parse_config_cnn(self, arguments, nnet_spec, conv_nnet_spec): self.parse_config_dnn(arguments, nnet_spec) # parse convolutional layer structure self.conv_layer_configs = parse_conv_spec(conv_nnet_spec, self.batch_size) # parse convolutional layer activation # parse activation function, including maxout if arguments.has_key('conv_activation'): self.conv_activation_text = arguments['conv_activation'] self.conv_activation = parse_activation(arguments['conv_activation']) # maxout not supported yet # whether we use the fast version of convolution if arguments.has_key('use_fast'): self.use_fast = string_2_bool(arguments['use_fast'])
def parse_config_cldnn(self, arguments, nnet_spec, conv_nnet_spec, lstm_nnet_spec): self.parse_config_common(arguments) # parse CNN network structure self.conv_layer_configs = parse_conv_spec(conv_nnet_spec, self.batch_size) if arguments.has_key('conv_activation'): self.conv_activation_text = arguments['conv_activation'] self.conv_activation = parse_activation(arguments['conv_activation']) if arguments.has_key('use_fast'): self.use_fast = string_2_bool(arguments['use_fast']) # parse LSTM network structure lstm_layers = lstm_nnet_spec.split(':') self.lstm_layers_sizes = [int(lstm_layers[i]) for i in range(0, len(lstm_layers))] # parse DNN network structure fc_layers = nnet_spec.split(':') self.hidden_layers_sizes = [int(fc_layers[i]) for i in range(0, len(fc_layers)-1)] self.n_outs = int(fc_layers[-1])