Module Import alias ImportFrom alias Import alias Import alias identifier Import alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call NameLoad Str Str attr attr Str attr Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call NameLoad Str Str attr attr Str attr Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call NameLoad Str Str attr attr Str attr Assign NameStore Str Assign NameStore Num Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Print Str Assign NameStore Call AttributeLoad Call AttributeLoad Call NameLoad Str attr attr Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad Print Str Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword Str orelse Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword BinOpAdd NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr If CompareGt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr For NameStore Call NameLoad BinOpSub AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr If CompareGt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr orelse Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad Call NameLoad BinOpAdd NameLoad Str Str attr NameLoad Print Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str Print Str Print Str For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Call NameLoad NameLoad Expr Call NameLoad NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad For TupleStore NameStore NameStore NameStore Call NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Num Call NameLoad NameLoad AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Num Call NameLoad NameLoad AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Num body Assign NameStore Call NameLoad NameLoad NameLoad If AttributeLoad NameLoad attr body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword ListLoad TupleLoad Str NameLoad If CompareEq BinOpMod NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Call AttributeLoad Str attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A sys random shuffle N/A argparse N/A numpy np N/A scipy.io keras.models Sequential keras.layers.core Dense Dropout Activation keras.optimizers SGD keras.utils np_utils generic_utils sklearn preprocessing sklearn.externals joblib spacy.en English features get_questions_matrix_sum get_images_matrix get_answers_matrix utils grouper selectFrequentAnswers main N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser N/A N/A N/A parser add_argument -num_hidden_units type int default 1024 N/A N/A N/A parser add_argument -num_hidden_layers type int default 3 N/A N/A N/A parser add_argument -dropout type float default 0.5 N/A N/A N/A parser add_argument -activation type str default tanh N/A N/A N/A parser add_argument -language_only type bool default False N/A N/A N/A parser add_argument -num_epochs type int default 100 N/A N/A N/A parser add_argument -model_save_interval type int default 10 N/A N/A N/A parser add_argument -batch_size type int default 128 N/A args N/A N/A parser parse_args N/A questions_train N/A N/A N/A N/A N/A N/A N/A open ../data/preprocessed/questions_train2014.txt r read decode utf8 splitlines N/A answers_train N/A N/A N/A N/A N/A N/A N/A open ../data/preprocessed/answers_train2014_modal.txt r read decode utf8 splitlines N/A images_train N/A N/A N/A N/A N/A N/A N/A open ../data/preprocessed/images_train2014.txt r read decode utf8 splitlines N/A vgg_model_path ../features/coco/vgg_feats.mat N/A maxAnswers 1000 N/A N/A questions_train answers_train images_train N/A selectFrequentAnswers questions_train answers_train images_train maxAnswers N/A labelencoder N/A N/A preprocessing LabelEncoder N/A N/A N/A labelencoder fit answers_train N/A nb_classes N/A len N/A list N/A labelencoder classes_ N/A N/A N/A joblib dump labelencoder ../models/labelencoder.pkl N/A features_struct N/A N/A N/A scipy io loadmat vgg_model_path N/A VGGfeatures N/A features_struct N/A feats N/A loaded vgg features N/A image_ids N/A N/A N/A N/A N/A open ../features/coco_vgg_IDMap.txt read splitlines N/A id_map N/A N/A ids image_ids N/A N/A id_split N/A N/A ids split N/A N/A id_map N/A N/A id_split N/A 0 N/A int N/A id_split N/A 1 N/A nlp N/A English N/A loaded word2vec features... N/A img_dim 4096 N/A word_vec_dim 300 N/A model N/A Sequential N/A N/A args language_only N/A N/A N/A N/A model add N/A Dense N/A args num_hidden_units input_dim word_vec_dim init uniform N/A N/A N/A N/A model add N/A Dense N/A args num_hidden_units input_dim N/A img_dim word_vec_dim init uniform N/A N/A N/A model add N/A Activation N/A args activation N/A N/A N/A args dropout 0 N/A N/A N/A N/A model add N/A Dropout N/A args dropout N/A i N/A xrange N/A N/A args num_hidden_layers 1 N/A N/A N/A N/A model add N/A Dense N/A args num_hidden_units init uniform N/A N/A N/A model add N/A Activation N/A args activation N/A N/A N/A args dropout 0 N/A N/A N/A N/A model add N/A Dropout N/A args dropout N/A N/A N/A model add N/A Dense nb_classes init uniform N/A N/A N/A model add N/A Activation softmax N/A json_string N/A N/A model to_json N/A N/A args language_only N/A N/A model_file_name N/A N/A N/A ../models/mlp_language_only_num_hidden_units_ N/A str N/A args num_hidden_units _num_hidden_layers_ N/A str N/A args num_hidden_layers N/A N/A model_file_name N/A N/A N/A ../models/mlp_num_hidden_units_ N/A str N/A args num_hidden_units _num_hidden_layers_ N/A str N/A args num_hidden_layers N/A N/A N/A N/A open N/A model_file_name .json w write json_string N/A Compiling model... N/A N/A N/A model compile loss categorical_crossentropy optimizer rmsprop N/A Compilation done... N/A Training started... N/A k N/A xrange N/A args num_epochs N/A N/A index_shuf N/A range N/A len questions_train N/A N/A shuffle index_shuf N/A questions_train N/A N/A questions_train N/A i N/A i index_shuf N/A answers_train N/A N/A answers_train N/A i N/A i index_shuf N/A images_train N/A N/A images_train N/A i N/A i index_shuf N/A progbar N/A N/A generic_utils Progbar N/A len questions_train N/A N/A qu_batch an_batch im_batch N/A zip N/A grouper questions_train N/A args batch_size fillvalue N/A questions_train N/A -1 N/A grouper answers_train N/A args batch_size fillvalue N/A answers_train N/A -1 N/A grouper images_train N/A args batch_size fillvalue N/A images_train N/A -1 N/A N/A X_q_batch N/A get_questions_matrix_sum qu_batch nlp N/A N/A args language_only N/A N/A X_batch X_q_batch N/A N/A X_i_batch N/A get_images_matrix im_batch id_map VGGfeatures N/A X_batch N/A N/A np hstack N/A X_q_batch X_i_batch N/A Y_batch N/A get_answers_matrix an_batch labelencoder N/A loss N/A N/A model train_on_batch X_batch Y_batch N/A N/A N/A progbar add N/A args batch_size values N/A N/A train loss loss N/A N/A N/A k N/A args model_save_interval 0 N/A N/A N/A N/A model save_weights N/A model_file_name N/A N/A _epoch_{:02d}.hdf5 format k N/A N/A N/A model save_weights N/A model_file_name N/A N/A _epoch_{:02d}.hdf5 format k N/A N/A N/A __name__ __main__ N/A N/A N/A main