cs224n-Squad-Project icon indicating copy to clipboard operation
cs224n-Squad-Project copied to clipboard

Still in epoch 1

Open vincentandreas opened this issue 6 years ago • 11 comments

I try to run your code, but it still in epoch one (not go to epoch two), but the iter increasing. I use several argprase when run your code

!python main.py --experiment_name=test --dropout=0.15 --batch_size=10 --hidden_size_encoder=20 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=30 --mode=train --gpu=1 --train_dir experiments

INFO:root:epoch 1, iter 3939, loss 6.04379, smoothed loss 6.18154, grad norm 4.54307, param norm 53.22952, batch time 1.682 INFO:root:epoch 1, iter 3940, loss 5.82439, smoothed loss 6.17797, grad norm 5.33789, param norm 53.23118, batch time 1.692

My question is, how many iter will do in one epoch? How to make one epoch only do 100 iter? and how long when you train SQUAD dataset using this code?

any response and answer from all of you will very help me. thank you

vincentandreas avatar May 24 '19 19:05 vincentandreas

The training will run for infinite time, you have to stop your training when model is fully learn. But I don't know what to do after that when model is fully learn from dataset. Screenshot from 2019-05-30 11-22-08

HarnishLJ avatar May 30 '19 05:05 HarnishLJ

@HarnishLJ but the strange thing is we still in epoch 1, even we already defined how many epoch when we run the main.py . I'm curious too, how we use trained model to do question answering like @priya-dwivedi website https://deeplearninganalytics.org/demos . Maybe anyone who read this issue can give us help?

vincentandreas avatar May 30 '19 08:05 vincentandreas

image @deperfecto Yes, I found this (See the picture) and In that they write (Number of epochs to train 0. 0 means train indefinitely)

HarnishLJ avatar May 30 '19 09:05 HarnishLJ

@HarnishLJ ooh, I don't realize it have default value in the flags, and I don't change the num_epoch parameter too, thanks for realize me.

vincentandreas avatar May 30 '19 11:05 vincentandreas

Ok welcome but tell me what to do next , I have trained this model up to 7000 iteration and still running, tell me where to stop training. and next what to do after stoping training. @deperfecto @priya-dwivedi image

HarnishLJ avatar May 30 '19 12:05 HarnishLJ

in flag mode, you can choose to 'show_examples', that will show random question, predicted answer, and the true answer. I have an idea to edit the code, so it can receive question for the user, and then predict the answer, Although it's strange, in the flag mode doesn't have 'test' mode .

vincentandreas avatar May 31 '19 03:05 vincentandreas

yes. It will be really helpful to me and all, If you share screenshots how to change code or flags, even I don't know which flag I have to change. Please share step by step screenshots.Thanks @deperfecto @priya-dwivedi

HarnishLJ avatar May 31 '19 05:05 HarnishLJ

@HarnishLJ The flag is mode=show_examples. (from the previous is mode=train)And this is the result when I execute that code.

!python /content/gdrive/"My Drive"/"Colab Notebooks"/cs224n-Squad-Project-master/code/main.py --experiment_name=aku_nyoba --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=show_examples --gpu=1  --train_dir /content/gdrive/"My Drive"/"Colab Notebooks"/experiments

examples

I'm sorry, I haven't implemented my idea, to change the code, because for now I try to adjust the dataset for my local language.

vincentandreas avatar May 31 '19 10:05 vincentandreas

hey @HarnishLJ, I found how to test using your own testing data, just make a json file, then use official_eval mode.

!python /content/gdrive/"My Drive"/"Colab Notebooks"/cs224n-Squad-Project-master/code/main.py --experiment_name=aku_nyoba --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=official_eval --gpu=1  --train_dir /content/gdrive/"My Drive"/"Colab Notebooks"/experiments   --json_in_path /content/gdrive/"My Drive"/"Colab Notebooks"/cs224n-Squad-Project-master/data/FOR-TEST.json --ckpt_load_dir=/content/gdrive/"My Drive"/"Colab Notebooks"/experiments

then, the code will make prediction.json file, you can open the file to look the generated answer

*FOR-TEST json file format is like train-v1.1.json format, but without answer, and answer_start, you can edit the json

vincentandreas avatar Jun 25 '19 05:06 vincentandreas

@HarnishLJ The flag is mode=show_examples. (from the previous is mode=train)And this is the result when I execute that code.

!python /content/gdrive/"My Drive"/"Colab Notebooks"/cs224n-Squad-Project-master/code/main.py --experiment_name=aku_nyoba --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=show_examples --gpu=1  --train_dir /content/gdrive/"My Drive"/"Colab Notebooks"/experiments

examples

I'm sorry, I haven't implemented my idea, to change the code, because for now I try to adjust the dataset for my local language.

@HarnishLJ btw, how good your result by testing using show_examples mode? My result is not too good, just 5 correct from 10 questions, I don't know how to increase the result. Maybe anyone who read this can told us how good when you show_example the model?

vincentandreas avatar Jun 25 '19 05:06 vincentandreas

Hi @deperfecto @HarnishLJ @priya-dwivedi @yuzehe , Actually I am at initial state only at first i run with --mode=train and in code i had given the no of epochs=5 but its is still in epoch 1 and iterations are increases. at first i run with 1.python code/main.py --experiment_name=bidaf_best --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=train

supose after some x iterations i tried like

2.python code/main.py --experiment_name=bidaf_best --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=shoow_examples

and later what i have to do for testing purpose getting questions and answers

@deperfecto earlier comments you have discussed like test with some json file how can i do that testing process and how good the result be can you explain me clearly

Thank and Regards, Manikantha Sekhar.

mady143 avatar Feb 28 '20 06:02 mady143