📚 The CoCalc Library - books, templates and other resources
License: OTHER
""" A neural chatbot using sequence to sequence model with1attentional decoder.23This is based on Google Translate Tensorflow model4https://github.com/tensorflow/models/blob/master/tutorials/rnn/translate/56Sequence to sequence model by Cho et al.(2014)78Created by Chip Huyen as the starter code for assignment 3,9class CS 20SI: "TensorFlow for Deep Learning Research"10cs20si.stanford.edu1112This file contains the hyperparameters for the model.1314See readme.md for instruction on how to run the starter code.15"""1617# parameters for processing the dataset18DATA_PATH = '/Users/Chip/data/cornell movie-dialogs corpus'19CONVO_FILE = 'movie_conversations.txt'20LINE_FILE = 'movie_lines.txt'21OUTPUT_FILE = 'output_convo.txt'22PROCESSED_PATH = 'processed'23CPT_PATH = 'checkpoints'2425THRESHOLD = 22627PAD_ID = 028UNK_ID = 129START_ID = 230EOS_ID = 33132TESTSET_SIZE = 250003334# model parameters35""" Train encoder length distribution:36[175, 92, 11883, 8387, 10656, 13613, 13480, 12850, 11802, 10165,378973, 7731, 7005, 6073, 5521, 5020, 4530, 4421, 3746, 3474, 3192,382724, 2587, 2413, 2252, 2015, 1816, 1728, 1555, 1392, 1327, 1248,391128, 1084, 1010, 884, 843, 755, 705, 660, 649, 594, 558, 517, 475,40426, 444, 388, 349, 337]41These buckets size seem to work the best42"""43# [19530, 17449, 17585, 23444, 22884, 16435, 17085, 18291, 18931]44# BUCKETS = [(6, 8), (8, 10), (10, 12), (13, 15), (16, 19), (19, 22), (23, 26), (29, 32), (39, 44)]4546# [37049, 33519, 30223, 33513, 37371]47# BUCKETS = [(8, 10), (12, 14), (16, 19), (23, 26), (39, 43)]4849# BUCKETS = [(8, 10), (12, 14), (16, 19)]50BUCKETS = [(16, 19)]5152NUM_LAYERS = 353HIDDEN_SIZE = 25654BATCH_SIZE = 645556LR = 0.557MAX_GRAD_NORM = 5.05859NUM_SAMPLES = 512606162