Skip to content

Instantly share code, notes, and snippets.

View DrBoltzmann's full-sized avatar

Mark Melnykowycz DrBoltzmann

View GitHub Profile
from collections import deque
from itertools import count
import time
import torch
import matplotlib.pyplot as plt
%matplotlib inline
from agent import Agent
import random
@DrBoltzmann
DrBoltzmann / model.py
Created June 18, 2019 20:47
Neural network model for DDPG agent for tennis env
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1. / np.sqrt(fan_in)
return (-lim, lim)
@DrBoltzmann
DrBoltzmann / agent.py
Created June 18, 2019 20:45
DDPG agent for tennis env
import numpy as np
from numpy import random as nprandom
import random
import copy
from collections import namedtuple, deque
from model import Actor, Critic
import torch
import torch.nn.functional as F
@DrBoltzmann
DrBoltzmann / conv3dnet.py
Created June 18, 2018 08:13 — forked from dansileshi/conv3dnet.py
Example of 3D convolutional network with TensorFlow
import tensorflow as tf
import numpy as np
FC_SIZE = 1024
DTYPE = tf.float32
def _weight_variable(name, shape):
return tf.get_variable(name, shape, DTYPE, tf.truncated_normal_initializer(stddev=0.1))