Skip to content

Instantly share code, notes, and snippets.

🤖
On research

Takuma Seno takuseno

🤖
On research
Block or report user

Report or block takuseno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@takuseno
takuseno / td3.py
Created Jun 8, 2019
Twin Delayed Deep Deterministic Policy Gradients (TD3) implementation with NNabla
View td3.py
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.solvers as S
import argparse
import random
import os
import gym
@takuseno
takuseno / ddpg.py
Last active Jun 8, 2019
Deep Deterministic Policy Gradients implementation with NNabla
View ddpg.py
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.solvers as S
import argparse
import random
import os
import gym
@takuseno
takuseno / dqn.py
Last active Apr 18, 2019
Deep Q-Network implementation with NNabla
View dqn.py
import numpy as np
import nnabla as nn
import nnabla.parametric_functions as PF
import nnabla.functions as F
import nnabla.solvers as S
import random
import argparse
import gym
import os
import cv2
@takuseno
takuseno / gpu_info.py
Created Oct 10, 2018
Parse nvidia-smi by Python
View gpu_info.py
from subprocess import Popen, PIPE
from xml.etree.ElementTree import fromstring
def main():
p = Popen(['nvidia-smi', '-q', '-x'], stdout=PIPE)
outs, errors = p.communicate()
xml = fromstring(outs)
num_gpus = int(xml.getiterator('attached_gpus')[0].text)
results = []
@takuseno
takuseno / reptile.py
Last active Jun 6, 2018
TensorFlow version of reptile sample https://blog.openai.com/reptile/
View reptile.py
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
mode = 'maml'
seed = 0
plot = True
innerstepsize = 0.02 # stepsize in inner SGD
innerepochs = 1 # number of epochs of each inner SGD
outerstepsize0 = 0.1 if mode == 'reptile' else 0.001 # stepsize of outer optimization, i.e., meta-optimization
You can’t perform that action at this time.