This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exp_lr_scheduler(optimizer, global_step, init_lr, decay_steps, decay_rate, lr_clip, staircase=True): | |
"""Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs.""" | |
if staircase: | |
lr = init_lr * decay_rate**(global_step // decay_steps) | |
else: | |
lr = init_lr * decay_rate**(global_step / decay_steps) | |
lr = max(lr, lr_clip) | |
if global_step % decay_steps == 0: | |
print('LR is set to {}'.format(lr)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download Google Drive files with WGET | |
Example Google Drive download link: | |
https://docs.google.com/open?id=[ID] | |
To download the file with WGET you need to use this link: | |
https://googledrive.com/host/[ID] | |
Example WGET command: |