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 gymnax | |
import flax.linen as nn | |
from argparse import ArgumentParser | |
import functools | |
from typing import Any, Callable, Sequence, Tuple, Optional, Sequence, Dict, Union, Iterable | |
import mctx | |
import warnings | |
from typing import Tuple, Optional, Union | |
import jax | |
import jax.numpy as jnp |
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 Optional | |
import torch | |
from torch import tensor | |
from tensordict import TensorDict | |
from torchrl.data import CompositeSpec, BoundedTensorSpec, UnboundedContinuousTensorSpec, UnboundedDiscreteTensorSpec, DiscreteTensorSpec, \ | |
UnboundedContinuousTensorSpec | |
from torchrl.envs import ( | |
EnvBase, | |
Transform, |
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 torch | |
import torch.nn.functional as F | |
import pytorch_lightning as pl | |
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor, EarlyStopping | |
from pytorch_lightning.plugins import DDPPlugin | |
from pl_bolts.datamodules import MNISTDataModule | |
class LightningMNISTClassifier(pl.LightningModule): |
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 torch | |
import torch.nn.functional as F | |
import torch.nn as nn | |
from torch.autograd import Function | |
from matplotlib import pyplot as plt | |
from torchvision.io import read_image | |
inf = float('inf') | |
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
mujoco in ~/.mujoco/mujoco200 (may need to rename) | |
ln -s ~/.mujoco/mujoco200 ~/.mujoco/mujoco200_linux | |
mujuco key in ~/.mujoco/mjkey.txt | |
sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3 | |
sudo apt-get install libglew-dev | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/duane/.mujoco/mujoco200/bin | |
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so | |
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
http://dev.jackcoldrick.com/custom-form-validation/ |
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
# If you change this file, run 'update-grub' afterwards to update | |
# /boot/grub/grub.cfg. | |
# For full documentation of the options in this file, see: | |
# info -f grub -n 'Simple configuration' | |
GRUB_DEFAULT=saved | |
GRUB_SAVEDEFAULT=true | |
GRUB_TIMEOUT_STYLE=menu |
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
# open the <env_name>/bin/activate | |
# add the below lines to the bottom | |
# | |
# CUDA 11.0 | |
LD_LIBRARY_PATH="/usr/local/cuda-11.0/lib64" | |
export LD_LIBRARY_PATH | |
PATH="/usr/local/cuda-11.0/bin:$PATH" | |
export PATH |
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 pygame, sys | |
from pygame.locals import * | |
import numpy as np | |
from math import radians, degrees | |
from numpy import cos, sin | |
from numpy.linalg import inv | |
from collections import OrderedDict | |
# Set up pygame | |
pygame.init() |
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 matplotlib import pyplot as plt | |
#rows, columns | |
layout = (2, 1) | |
fig = plt.figure(figsize=(12, 12), dpi=80) | |
fig.canvas.set_window_title(title='matplotlib object oriented demo') | |
positions = fig.add_subplot(*layout, 1, ) |
NewerOlder