rnn.wgan
1.0.0
"사전 훈련없이 재발 성 생성 적대자 네트워크를 가진 언어 생성"에서 모델의 교육 및 평가 코드.
논문의 짧은 요약은 여기에서 제공됩니다.
" There has been to be a place w
On Friday , the stories in Kapac
From should be taken to make it
He is conference for the first t
For a lost good talks to ever ti
CL+VL+TH 모델 교육을 시작하려면 먼저 http://www.statmt.org/lm-benchmark/에서 사용할 수있는 데이터 세트를 다운로드하여 ./data 디렉토리로 추출하십시오.
그런 다음 다음 명령을 사용하십시오.
python curriculum_training.py
다음 패키지가 필요합니다.
다음 매개 변수를 구성 할 수 있습니다.
LOGS_DIR: Path to save model checkpoints and samples during training (defaults to './logs/')
DATA_DIR: Path to load the data from (defaults to './data/1-billion-word-language-modeling-benchmark-r13output/')
CKPT_PATH: Path to checkpoint file when restoring a saved model
BATCH_SIZE: Size of batch (defaults to 64)
CRITIC_ITERS: Number of iterations for the discriminator (defaults to 10)
GEN_ITERS: Number of iterations for the geneartor (defaults to 50)
MAX_N_EXAMPLES: Number of samples to load from dataset (defaults to 10000000)
GENERATOR_MODEL: Name of generator model (currently only 'Generator_GRU_CL_VL_TH' is available)
DISCRIMINATOR_MODEL: Name of discriminator model (currently only 'Discriminator_GRU' is available)
PICKLE_PATH: Path to PKL directory to hold cached pickle files (defaults to './pkl')
ITERATIONS_PER_SEQ_LENGTH: Number of iterations to run per each sequence length in the curriculum training (defaults to 15000)
NOISE_STDEV: Standard deviation for the noise vector (defaults to 10.0)
DISC_STATE_SIZE: Discriminator GRU state size (defaults to 512)
GEN_STATE_SIZE: Genarator GRU state size (defaults to 512)
TRAIN_FROM_CKPT: Boolean, set to True to restore from checkpoint (defaults to False)
GEN_GRU_LAYERS: Number of GRU layers for the genarator (defaults to 1)
DISC_GRU_LAYERS: Number of GRU layers for the discriminator (defaults to 1)
START_SEQ: Sequence length to start the curriculum learning with (defaults to 1)
END_SEQ: Sequence length to end the curriculum learning with (defaults to 32)
SAVE_CHECKPOINTS_EVERY: Save checkpoint every # steps (defaults to 25000)
LIMIT_BATCH: Boolean that indicates whether to limit the batch size (defaults to true)
구성 파일에서 값을 변경하거나 터미널에 전달하여 매개 변수를 설정할 수 있습니다.
python curriculum_training.py --START_SEQ=1 --END_SEQ=32
generate.py 스크립트는 저장된 모델을 사용하여 BATCH_SIZE 샘플을 생성합니다. 모델을 훈련시키는 데 사용되는 매개 변수를 사용하여 실행해야합니다 (기본값과 다른 경우). 예를 들어:
python generate.py --CKPT_PATH=/path/to/checkpoint/seq-32/ckp --DISC_GRU_LAYERS=2 --GEN_GRU_LAYERS=2
(모델이 커리큘럼에서 32 단계에 도달하지 않은 경우, 모델이 훈련 한 커리큘럼의 최대 단계로 위의 경로에서 '32'를 변경하십시오.)
%-in-test-n 메트릭을 사용하여 샘플을 평가하려면 각 행이 샘플 인 TXT 파일에 연결하는 다음 명령을 사용하십시오.
python evaluate.py --INPUT_SAMPLE=/path/to/samples.txt
이 코드가 유용하다고 생각되면 다음 논문을 인용하십시오.
@article{press2017language,
title={Language Generation with Recurrent Generative Adversarial Networks without Pre-training},
author={Press, Ofir and Bar, Amir and Bogin, Ben and Berant, Jonathan and Wolf, Lior},
journal={arXiv preprint arXiv:1706.01399},
year={2017}
}
이 저장소는 Wasserstein Gans의 개선 된 교육에 게시 된 코드를 기반으로합니다.