Skip to content

Instantly share code, notes, and snippets.

View davidnvq's full-sized avatar
🎯
Focusing

Van-Quang Nguyen davidnvq

🎯
Focusing
View GitHub Profile
@davidnvq
davidnvq / lr_adjust.py
Last active April 25, 2019 02:06
Adaptive learning rate example from ImageNet
# https://github.com/pytorch/examples/blob/master/imagenet/main.py#L392-L396
def adjust_learning_rate(optimizer, epoch, args):
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
lr = args.lr * (0.1 ** (epoch // 30))
for param_group in optimizer.param_groups:
param_group['lr'] = lr
# Create a learning rate adjustment function that divides the learning rate by 10 every 30 epochs
def adjust_learning_rate(epoch):
@etendue
etendue / test.py
Created April 24, 2019 18:59
test script
import multiprocessing as mp
import ai2thor.controller
import numpy as np
import time
import os
actions = [
'MoveAhead',
'MoveBack',
'MoveRight',