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 math import floor, log10 | |
def sig_figs(x: float, precision: int): | |
""" | |
Rounds a number to number of significant figures | |
Parameters: | |
- x - the number to be rounded | |
- precision (integer) - the number of significant figures |
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
#!/bin/sh | |
ssh -L 8888:localhost:8888 -L 6006:localhost:6006 bob@192.168.1.199 |
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
#!/bin/bash | |
remotedir="bob@192.168.1.199:/gpu" # TODO Add directory on the remote machine | |
mountdir="/Users/bob/gpu" # TODO Add local directory | |
echo "Mounting (${mountdir})..." | |
#Unmount if it's already mounted | |
if mount | grep "on $mountdir" > /dev/null; then | |
umount ${mountdir} |
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
# pytorch_mnist.py | |
# Simple MNIST training script on Pytorch to confirm installation is working correctly | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import torchvision | |
n_epochs = 3 |
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
# benchmark.py | |
from ai_benchmark import AIBenchmark | |
benchmark = AIBenchmark() | |
results = benchmark.run() |
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
# tensorflow_mnist.py | |
# A simple Tensorflow 2 MNIST training script to test installation is working correctly. | |
import tensorflow as tf | |
import tensorflow_datasets as tfds | |
(ds_train, ds_test), ds_info = tfds.load( | |
'mnist', | |
split=['train', 'test'], | |
shuffle_files=True, |
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
backend: | |
build: . | |
ports: | |
- 8999:80 | |
env_file: .env | |
restart: unless-stopped | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.backend.rule=Host(`app.example.com`)" | |
- "traefik.http.routers.backend.entrypoints=websecure" |
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
traefik: | |
image: "traefik:v2.5" | |
container_name: "traefik" | |
command: | |
#- "--log.level=DEBUG" | |
- "--api.insecure=true" | |
- "--providers.docker=true" | |
- "--providers.docker.exposedbydefault=false" | |
- "--entrypoints.websecure.address=:443" | |
- "--certificatesresolvers.myresolver.acme.tlschallenge=true" |
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
version: "3.4" | |
services: | |
backend: | |
build: . | |
ports: | |
- 80:80 | |
env_file: .env | |
restart: unless-stopped |
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 | |
CWD = os.path.dirname(os.path.abspath(__file__)) | |
#CWD then has the absolute path to this current file |
NewerOlder