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 pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime | |
ARG USER="user" | |
ARG UID="1000" | |
ARG GID="100" | |
USER "root" | |
RUN apt-get update && apt-get install -y gnupg |
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 | |
def spirals(n_samples=400): | |
N = n_samples | |
theta = np.sqrt(np.random.rand(N))*2*np.pi | |
r_a = 2*theta + np.pi | |
data_a = np.array([np.cos(theta)*r_a, np.sin(theta)*r_a]).T | |
x_a = data_a + np.random.randn(N,2) |
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
# Based on min-char-rnn.py | |
# https://gist.github.com/karpathy/d4dee566867f8291f086 | |
import torch as th | |
import torch.nn as nn | |
import numpy as np | |
class Model(nn.Module): | |
def __init__(self, hidden_size, vocab_size, num_layers): |
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 copy import deepcopy | |
from typing import Any, Dict, Generator, List, Optional, Union | |
from typing import NamedTuple, Tuple | |
from gymnasium import spaces | |
import numpy as np | |
import torch as th | |
from stable_baselines3.common.buffers import BaseBuffer | |
from stable_baselines3.common.vec_env import VecNormalize |
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 pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime | |
ARG USER="user" | |
ARG UID="1000" | |
ARG GID="100" | |
USER "root" | |
RUN apt-get update && apt-get install -y gnupg |
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
version: '3.1' | |
services: | |
db: | |
image: mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: CHANGE_THIS_PASSWORD | |
MYSQL_DATABASE: test_db |
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
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
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 pandas as pd | |
# .read_csv() | |
# .shape | |
# .head(N) .tail(N) | |
# .dtypes | |
# .loc[3, 'sepal_length'] .iloc | |
# .to_csv() | |
# pd.set_option('max_columns', 2) |
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 sys | |
import gym | |
from gym.envs.registration import register | |
from tensorforce.environments import Environment | |
from tensorforce.agents import Agent | |
if len(sys.argv) < 2: | |
print("Usage: python {} path/to/checkpoint".format(sys.argv[0])) |
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
/* NB: HAT speaker needs to be connected */ | |
#include <M5StickC.h> | |
#include "esp32-hal-timer.h" | |
volatile int interruptCounter; | |
int totalInterruptCounter; | |
// https://techtutorialsx.com/2017/10/07/esp32-arduino-timer-interrupts/ | |
hw_timer_t * timer = NULL; //Created Hardware Timer |
NewerOlder