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 sys | |
import math | |
import random | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
def encoder(observation): | |
with tf.variable_scope('encoder', reuse=tf.AUTO_REUSE): |
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 os | |
import shutil | |
import time | |
from os.path import join | |
import cv2 | |
import deepmind_lab | |
import gym | |
import numpy as np | |
from gym.utils import seeding |
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
class VizdoomEnvMultiplayer(VizdoomEnv): | |
def __init__(self, level, player_id, num_players, skip_frames, level_map='map01'): | |
super().__init__(level, skip_frames=skip_frames, level_map=level_map) | |
self.player_id = player_id | |
self.num_players = num_players | |
self.timestep = 0 | |
self.update_state = True | |
def _is_server(self): |
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
#include <Corrade/Containers/GrowableArray.h> | |
#include <Corrade/Containers/Optional.h> | |
#include <Magnum/GL/Buffer.h> | |
#include <Magnum/GL/DefaultFramebuffer.h> | |
#include <Magnum/GL/Mesh.h> | |
#include <Magnum/GL/Renderer.h> | |
#include <Magnum/Math/Color.h> | |
#include <Magnum/Math/Matrix4.h> | |
#include <Magnum/MeshTools/Interleave.h> |
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
from typing import Tuple | |
import torch | |
import torch.nn as nn | |
from torch.nn.utils.rnn import PackedSequence, invert_permutation | |
def _build_pack_info_from_dones( | |
dones, T: int | |
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: |
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
""" | |
This script clones students' github repos with HW solutions, checks out a commit specified by the student, | |
and runs corresponding tests, generating a directory with reports. | |
Just place the script into the root of cloned "tests" repo and change global variables below appropriately. | |
Then run as "python batch_grade.py" | |
""" | |
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 os | |
import sys | |
import argparse | |
import subprocess | |
from os import listdir | |
from os.path import isfile, join | |
def main(): |