The source code for the paper "Imitation Learning for Sentence Generation with Dilated Convolutions Using Adversarial Training".
1. For data preprocessing :
python preprocess.py
The preprocessing must be done before training. The default path of the dataset is "./dataset/kit.txt" in preprocessing.py. If you want to use another dataset, please change the src_path variable in preprocessing.py. For the format of the dataset, please refer to the file in the "dataset" folder.
2. For pre-training word2vec (Optional) :
python train_word2vec.py
The trained parameter will be saved in the "save_embed" folder.
3. For pre-training the model with MLE (Optional) :
python train_mle.py
The trained parameter will be saved in the "save" folder.
4. For training the model with policy gradient :
python train_pg.py
The trained parameter will be saved in the "save" folder. The code implements the Actor-Critic algorithm for policy gradient training.
5. For testing :
python test.py
The output sentences with different temperature values will be saved in the "result" folder.
Model | Sentences |
---|---|
Real Sentences | A standing person waves with both hands . A human performs a 90o , a 180o and a 360o counter clockwise jump . |
λ=1.00 | Somebody walking forward while afterwards three goes forward , first up and ... A passenger cat hydrant is next to a toy establishment the mountains in a signs baby . |
λ=0.10 | A human walks in a 90o curve . The human goes four half steps . |
λ=0.01 | A human walks a jump to the left . A person jumps to the right and stairs . |
λ=0.00 | Subject jumps backwards . A person goes left . |
Model | Sentences |
---|---|
Real Sentences | A blue boat themed bathroom with a life preserver on the wall . Two cars parked on the sidewalk on the street . |
λ=1.00 | A young image in a ground behind many sink in the . area . a field and people to ... A person is walking forward a quarter circle to the left . |
λ=0.10 | Boat reaches over towards the brick wall . A couple of white people stand along a white bus . |
λ=0.01 | A blue plate of bags of elephants feeds out of mirror . A motorcycle older walk with a tie in the train . |
λ=0.00 | A man in a pair of grass setting . A brick table with a plane and shower . |