(self, test=False, args=args)
options in this function
options in this function
options in this function
def __init__(self, test=False, args=args):
        """options in this function"""
        self.config = Config()

        self.weight_Path = args.weight_path
        if args.load_config == False:
            self.config.saveConfig(self.weight_Path+'/config')
            print 'default configuration generated, please specify --load-config and run again.'
            sys.exit()
        else:
            if os.path.exists(self.weight_Path+'/config'):
                self.config.loadConfig(self.weight_Path+'/config')
            else:
                self.config.saveConfig(self.weight_Path+'/config') #if not exists config file then use default


        self.load_data(test)

        self.add_placeholders()
        inputs = self.add_embedding()
        self.logits = self.add_model(inputs)

        self.predict_prob = tf.nn.softmax(self.logits, name='predict_probability_soft')


        self.loss = self.add_loss_op(self.logits, tf.to_float(self.ph_label))
        self.train_op = self.add_train_op(self.loss)
def __init__ ( self , test = False , args = args ) : self . config = Config ( ) self . weight_Path = args . weight_path if args . load_config == False : self . config . saveConfig ( self . weight_Path + '/config' ) print 'default configuration generated, please specify --load-config and run again.' sys . exit ( ) else : if os . path . exists ( self . weight_Path + '/config' ) : self . config . loadConfig ( self . weight_Path + '/config' ) else : self . config . saveConfig ( self . weight_Path + '/config' ) #if not exists config file then use default self . load_data ( test ) self . add_placeholders ( ) inputs = self . add_embedding ( ) self . logits = self . add_model ( inputs ) self . predict_prob = tf . nn . softmax ( self . logits , name = 'predict_probability_soft' ) self . loss = self . add_loss_op ( self . logits , tf . to_float ( self . ph_label ) ) self . train_op = self . add_train_op ( self . loss )