Skip to content

Instantly share code, notes, and snippets.

View thejevans's full-sized avatar

John Evans thejevans

View GitHub Profile
#!/bin/sh
if nvidia-docker run -d -it -p $JUPYTERPORT:8888 --name $USER-jupyter_gpu -v /data/users/$USER/notebooks:/notebooks \
thejevans/jupyter-tensorflow-keras-opencv-gpu /bin/bash -c "useradd -u $UID $USER; jupyter notebook --allow-root" 2> /dev/null
then
echo "booting into container..."
else
docker start $USER-jupyter_gpu > /dev/null
echo "starting container..."
fi
echo "your port is $JUPYTERPORT"
epoch = 0
def next_batch(images, labels, start, batch_size):
global epoch
end = start + batch_size
if end > len(images):
# After each epoch we update this
epoch += 1
start = 0
# coding: utf-8
# ### Homework 4
# #### Problem 3 -- Autoencoder
# ###### John Evans
# ###### 4/26/18
# ##### Imports
echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
echo 1 > /sys/bus/pci/rescan
sleep 1
# Card has nvidia driver
lspci -nnk -d 10de:1c03
lspci -nnk -d 10de:10f1
# Card has nvidia driver
lspci -nnk -d 10de:1c03
lspci -nnk -d 10de:10f1
modprobe vfio
modprobe vfio_pci
# VGA
echo '0000:01:00.0' > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo '10de 1c03' > /sys/bus/pci/drivers/vfio-pci/new_id
#!/usr/bin/python
import sys
from array import *
# returns true if x is prime, false is not
def is_prime(x):
if x < 2:
return True
if x >= 2:
I set everything up in a stable way on my home system, finally. This has gpu support.
you have a home directory that is fast, but doesn't have much space:
~/
you have a data directory that is a bit slower, but has tons of space:
/data/users/<username>
your jupyter directory is:
/data/users/<username>/notebooks
proxy:
secretToken: "6b6847da2357051a396859394124027c730f8a47dd82ac22fa7a3491fa72d25b"
https:
hosts:
- jupyter.thejevans.com
letsencrypt:
contactEmail: thejevans@gmail.com
hub:
extraEnv:
"""
John Evans
PHYS476
Homework 2
Problem 1
3/10/2018
"""
import sys
from sklearn.neighbors import KNeighborsClassifier
import pandas as pd
"""
John Evans
PHYS476
Homework 2
Problem 2
3/10/2018
"""
import sys
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier