File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 3131 --learning-rate=<rate> Model learning rate [default: 3e-4].
3232 --hidden-units=<n> Number of units in hidden layer [default: 64].
3333 --batch-size=<n> How many experiences per gradient descent update step [default: 64].
34+ --keep-checkpoints=<n> How many model checkpoints to keep [default: 5].
3435'''
3536
3637options = docopt (_USAGE )
4546summary_freq = int (options ['--summary-freq' ])
4647save_freq = int (options ['--save-freq' ])
4748env_name = options ['<env>' ]
49+ keep_checkpoints = int (options ['--keep-checkpoints' ])
4850
4951# Algorithm-specific parameters for tuning
5052gamma = float (options ['--gamma' ])
7981 os .makedirs (summary_path )
8082
8183init = tf .global_variables_initializer ()
82- saver = tf .train .Saver ()
84+ saver = tf .train .Saver (max_to_keep = keep_checkpoints )
8385
8486with tf .Session () as sess :
8587 # Instantiate model parameters
You can’t perform that action at this time.
0 commit comments