This file contains 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
import argparse | |
import numpy as np # Version 1.13.1 | |
import tensorflow as tf # Version 1.4.1 | |
import mxnet as mx # Version 1.1.0 | |
from mxnet import gluon, nd, autograd | |
# From openai baselines common/tf_util | |
def dense(x, size, name, weight_init=None, bias=True): | |
w = tf.get_variable(name + "/w", [x.get_shape()[1], size], initializer=weight_init) | |
ret = tf.matmul(x, w) |
This file contains 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
# Policy gradient borrowed from https://github.com/pytorch/examples/ | |
import time | |
import argparse | |
import torch | |
import torchvision | |
import numpy as np | |
import torchvision.transforms as transforms | |
import torch.nn as nn |