#!/bin/bash
# Copyright 2018 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================


# TUNING IS NOT CURRENTLY SUPPORTED IN THE OPEN-SOURCE VERSION. This for
# illustration only.

set -e

# Include definitions of dataset and tuning related variables.
source "$(dirname $0)/../../lib/setup.sh" "$1"
source_lib "config/common.sh"
source_lib "config/tuning.sh"

name="$2"
config_file="$3/config"
load_checkpoint="$3/best"

save_checkpoints=false
turns=0

# Evaluation

dyneval=true
batch_size=1024
max_training_eval_batches=500
max_grad_norm=0.0
eval_softmax_temperature=-0.8
eval_softmax_temperature_estimation_num_tokens=50000
l2_penalty=0.0

# Tuning parameters

priority=200
num_workers=60

tuneables="batch_size,max_time_steps,
  dyneval_learning_rate,dyneval_decay_rate,dyneval_epsilon"
name="$(default_name)_${name}"
source_lib "run.sh" "$1"
