def parse_config_common(self, arguments):
        if arguments.has_key('gbrbm_learning_rate'):
            self.gbrbm_learning_rate = float(arguments['gbrbm_learning_rate'])
        if arguments.has_key('learning_rate'):
            self.learning_rate = float(arguments['learning_rate'])
        if arguments.has_key('batch_size'):
            self.batch_size = int(arguments['batch_size'])
        if arguments.has_key('epoch_number'):
            self.epochs = int(arguments['epoch_number'])

        # momentum setting is more complicated than dnn
        if arguments.has_key('momentum'):
            momentum_elements = arguments['momentum'].split(':')
            if len(momentum_elements) != 3:
                print "Error: momentum string should have 3 values, e.g., 0.5:0.9:5"
                exit(1)
            self.initial_momentum = float(momentum_elements[0])
            self.final_momentum = float(momentum_elements[1])
            self.initial_momentum_epoch = int(momentum_elements[2])

        # parse DNN network structure
        nnet_layers = arguments['nnet_spec'].split(':')
        self.n_ins = int(nnet_layers[0])
        self.hidden_layers_sizes = [int(nnet_layers[i]) for i in range(1, len(nnet_layers)-1)]
        self.n_outs = int(nnet_layers[-1])

        # parse pre-training layer number and the type of the first layer
        self.ptr_layer_number = len(self.hidden_layers_sizes)
        if arguments.has_key('ptr_layer_number'):
            self.ptr_layer_number = int(arguments['ptr_layer_number'])
        if arguments.has_key('first_layer_type') and arguments['first_layer_type'] == 'bb':
            self.first_layer_gb = False

        # parse various paths for model saving
        if arguments.has_key('cfg_output_file'):
            self.cfg_output_file = arguments['cfg_output_file']
        if arguments.has_key('param_output_file'):
            self.param_output_file = arguments['param_output_file']
        if arguments.has_key('kaldi_output_file'):
            self.kaldi_output_file = arguments['kaldi_output_file']
dataset/ETHPy150Open yajiemiao/pdnn/utils/rbm_config.py/RBMConfig.parse_config_common/original