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/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" |
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
| 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 |
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
| # coding: utf-8 | |
| # ### Homework 4 | |
| # #### Problem 3 -- Autoencoder | |
| # ###### John Evans | |
| # ###### 4/26/18 | |
| # ##### Imports |
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
| 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 |
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
| # 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 |
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
| #!/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: |
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
| 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 |
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
| proxy: | |
| secretToken: "6b6847da2357051a396859394124027c730f8a47dd82ac22fa7a3491fa72d25b" | |
| https: | |
| hosts: | |
| - jupyter.thejevans.com | |
| letsencrypt: | |
| contactEmail: thejevans@gmail.com | |
| hub: | |
| extraEnv: |
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
| """ | |
| John Evans | |
| PHYS476 | |
| Homework 2 | |
| Problem 1 | |
| 3/10/2018 | |
| """ | |
| import sys | |
| from sklearn.neighbors import KNeighborsClassifier | |
| import pandas as pd |
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
| """ | |
| John Evans | |
| PHYS476 | |
| Homework 2 | |
| Problem 2 | |
| 3/10/2018 | |
| """ | |
| import sys | |
| from sklearn.tree import DecisionTreeClassifier | |
| from sklearn.ensemble import RandomForestClassifier |