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
| main() { | |
| # Only enable exit-on-error after the non-critical colorization stuff, | |
| # which may fail on systems lacking tput or terminfo | |
| set -e | |
| if [ ! -n "$ZSH" ]; then | |
| ZSH=~/.oh-my-zsh | |
| fi |
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
| apt-get update | |
| apt-get upgrade -y | |
| apt-get install -y sudo htop vim screen sharutils zsh cifs-utils python-pip curl git | |
| newuser="pimouss" | |
| useradd ${newuser} --create-home | |
| mkdir /home/${newuser}/.ssh | |
| chmod 700 /home/${newuser}/.ssh | |
| cp .ssh/authorized_keys* /home/${newuser}/.ssh/ | |
| chown -R ${newuser}.${newuser} /home/${newuser}/.ssh |
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
| smith@wesson:~$ /usr/bin/time -f "\trendered in %e secs..." python raytracing.py 1 | |
| rendered in 8.36 secs... | |
| smith@wesson:~$ /usr/bin/time -f "\trendered in %e secs..." python raytracing.py 2 | |
| rendered in 10.82 secs... | |
| smith@wesson:~$ /usr/bin/time -f "\trendered in %e secs..." python raytracing.py 3 | |
| rendered in 13.30 secs... | |
| smith@wesson:~$ /usr/bin/time -f "\trendered in %e secs..." python raytracing.py 4 | |
| rendered in 13.40 secs... |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| w = 400 | |
| h = 300 | |
| def normalize(x): | |
| x /= np.linalg.norm(x) | |
| return x |
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
| smith@wesson:~$ python callMC.py 100000 | |
| Call price: 39.1021 | |
| smith@wesson:~$ python callMC.py 1000000 | |
| Call price: 38.8676 | |
| smith@wesson:~$ python callMC.py 10000000 | |
| Call price: 38.8956 |
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
| smith@wesson:~$ python callMc.py 100000 | |
| 3.112 | |
| smith@wesson:~$ python piMc.py 2 1000000 | |
| 3.128 |
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 | |
| from random import gauss | |
| from math import exp, sqrt | |
| S_0 = 863.00 # underlying spot price | |
| sigma = 0.20 # volatility of 20.00% | |
| r = 0.0118 # risk free rate of 1.18% | |
| T = 100/365.0 # maturity in 100 days | |
| K = 860.00 # strike | |
| paths = int(sys.argv[1]) |
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
| >>> y[0] | |
| 0.0 | |
| >>>X[0].reshape((28,28)) | |
| array([[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 159, 253, 159, 50, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 238, 252, 252, 252, 237, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 227, 253, 252, |
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
| 1> (n_neighbors: 2 , weigths: distance) | |
| 0> (n_neighbors: 2 , weigths: uniform) | |
| 2> (n_neighbors: 3 , weigths: uniform) | |
| 3> (n_neighbors: 3 , weigths: distance) | |
| 0> Training set score: 0.994200 | |
| 1> Training set score: 1.000000 | |
| 2> Training set score: 0.995274 | |
| 3> Training set score: 1.000000 | |
| 1> Test set score: 0.999785 | |
| 0> Test set score: 0.993986 |
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 qarnot | |
| conn = qarnot.connection.Connection(client_token='<YOUR_API_TOKEN>') | |
| task = conn.create_task('mnist-digitRecognition', 'docker-network', 4) | |
| d = conn.create_disk('disk') | |
| d.add_file('mnist_knn2.py') | |
| task.resources.append(d) | |
| task.constants['DOCKER_REPO'] = 'buildo/docker-python2.7-scikit-learn' | |
| task.constants['DOCKER_CMD'] = 'python mnist_knn2.py ${FRAME_ID}' | |
| task.run() |
NewerOlder