import ipyparallel as ipp
rc = ipp.Client()
rc.ids
/home/hegder/anaconda3/envs/deep/lib/python3.6/site-packages/ipyparallel/client/client.py:459: RuntimeWarning: Controller appears to be listening on localhost, but not on this machine. If this is true, you should specify Client(...,sshserver='you@Gamma') or instruct your controller to listen on an external IP. RuntimeWarning)
[0, 1, 2, 3, 4, 5, 6, 7]
%%px
import numpy as np
import h5py
from sklearn.model_selection import train_test_split
#now load this dataset
h5f = h5py.File('./datasets/s8_sio2tio2_v2.h5','r')
X = h5f['sizes'][:]
Y = h5f['spectrum'][:]
#get the ranges of the loaded data
num_layers = X.shape[1]
num_lpoints = Y.shape[1]
size_max = np.amax(X)
size_min = np.amin(X)
size_av = 0.5*(size_max + size_min)
#this information is not given in the dataset
lam_min = 300
lam_max = 1200
lams = np.linspace(lam_min, lam_max, num_lpoints)
#create a train - test split of the dataset
x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size=0.55, random_state=42)
# normalize inputs
x_train = (x_train - 50)/20
x_test = (x_test - 50)/20
print("Dataset has been loaded")
# print("x-train", x_train.shape)
# print("x-test ", x_test.shape)
# print("y-train", y_train.shape)
# print("y-test ", y_test.shape)
import warnings
warnings.filterwarnings('ignore')
import hyptune as htun
import scnets as scn
[stdout:0] Dataset has been loaded [stdout:1] Dataset has been loaded [stdout:2] Dataset has been loaded [stdout:3] Dataset has been loaded [stdout:4] Dataset has been loaded [stdout:5] Dataset has been loaded [stdout:6] Dataset has been loaded [stdout:7] Dataset has been loaded
%%px --target 0 --noblock
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
func = scn.resnet
param_grid = dict(num_units=[2],
red_dim=[8,16],
batch_size=[32, 64],
ker_size=[3, 5, 7])
cvresults = htun.get_cv_grid(modelfunc=func,
param_grid=param_grid,
num_epochs=250,
x_train=x_train,
y_train=y_train)
htres = htun.print_tuning_results(cvresults, func)
htres.to_csv('n2_cvsrch.dat')
<AsyncResult: execute>
%%px --target 1 --noblock
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
func = scn.resnet
param_grid = dict(num_units=[3],
red_dim=[8,16],
batch_size=[32, 64],
ker_size=[3, 5, 7])
cvresults = htun.get_cv_grid(modelfunc=func,
param_grid=param_grid,
num_epochs=250,
x_train=x_train,
y_train=y_train)
htres = htun.print_tuning_results(cvresults, func)
htres.to_csv('n3_cvsrch.dat')
<AsyncResult: execute>
%%px --target 2 --noblock
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
func = scn.resnet
param_grid = dict(num_units=[4],
red_dim=[8,16],
batch_size=[32, 64],
ker_size=[3, 5, 7])
cvresults = htun.get_cv_grid(modelfunc=func,
param_grid=param_grid,
num_epochs=250,
x_train=x_train,
y_train=y_train)
htres = htun.print_tuning_results(cvresults, func)
htres.to_csv('n4_cvsrch.dat')
<AsyncResult: execute>
%%px --target 3 --noblock
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
func = scn.resnet
param_grid = dict(num_units=[5],
red_dim=[8,16],
batch_size=[32, 64],
ker_size=[3, 5, 7])
cvresults = htun.get_cv_grid(modelfunc=func,
param_grid=param_grid,
num_epochs=250,
x_train=x_train,
y_train=y_train)
htres = htun.print_tuning_results(cvresults, func)
htres.to_csv('n5_cvsrch.dat')
<AsyncResult: execute>
%%px --target 4 --noblock
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
func = scn.resnet
param_grid = dict(num_units=[6],
red_dim=[8,16],
batch_size=[32, 64],
ker_size=[3, 5, 7])
cvresults = htun.get_cv_grid(modelfunc=func,
param_grid=param_grid,
num_epochs=250,
x_train=x_train,
y_train=y_train)
htres = htun.print_tuning_results(cvresults, func)
htres.to_csv('n6_cvsrch.dat')
<AsyncResult: execute>