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
| 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)) |
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
| 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 |
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
| 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) |
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
| 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 |