Skip to content

Instantly share code, notes, and snippets.

import gym
import tensorflow as tf
import numpy as np
import itertools
import tensorflow.contrib.layers as layers
from tqdm import trange
from gym.spaces import Discrete, Box
def get_traj(agent, env, max_episode_steps, render, deterministic_acts=False):
'''
@griver
griver / tmux_and_screen.md
Last active November 28, 2017 18:12 — forked from P7h/tmux_vs_screen.md
tmux vs screen commands

tmux and screen commands


Action tmux screen
start a new session tmux
tmux new
tmux new-session
screen
start a new session with a name tmux new -s name screen -S name
re-attach a detached session tmux attach
tmux attach-session
screen -r
re-attach a detached session with a name tmux attach -t name
tmux a -t name
screen -r name
re-attach an attached session (detaching it from elsewhere) tmux attach -dtmux attach-session -d screen -dr
@classmethod
def update_from_checkpoint(Cls, save_folder, network, optimizer=None,
use_best=False, use_cpu=False, ignore_layers=tuple()):
"""
Update network and optimizer(if specified) from the checkpoints in the save folder.
If use_best is True then the data is loaded from the Cls.CHECKPOINT_BEST file
otherwise the data is loaded from the Cls.CHECKPOINT_LAST file
Returns the number of global steps past for the loaded checkpoint.
Arguments:
save_folder (str): a path to a folder containing summaries and weights