Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1 lines (1 sloc) 5.86 KB
{"paragraphs":[{"title":"Imports","text":"%pyspark\nimport numpy as np\nimport keras\nimport skil","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python","editOnDblClick":false}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785660_-795873850","id":"20171206-185615_1754925880","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:09:36+0000","dateFinished":"2017-12-08T21:09:36+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:974"},{"title":"Skil Context","text":"%pyspark\n\nskilContext = skil.SkilContext(sc)","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python","editOnDblClick":false}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785660_-795873850","id":"20171206-185615_230942756","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:09:36+0000","dateFinished":"2017-12-08T21:09:36+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:975"},{"text":"%pyspark\n\nfrom __future__ import print_function\n\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout\nfrom keras.optimizers import RMSprop\n\nbatch_size = 128\nnum_classes = 10\nepochs = 5\n\n# the data, shuffled and split between train and test sets\n(x_train, y_train), (x_test, y_test) = mnist.load_data()\n\nx_train = x_train.reshape(60000, 784)\nx_test = x_test.reshape(10000, 784)\nx_train = x_train.astype('float32')\nx_test = x_test.astype('float32')\nx_train /= 255\nx_test /= 255\nprint(x_train.shape[0], 'train samples')\nprint(x_test.shape[0], 'test samples')\n\n# convert class vectors to binary class matrices\ny_train = keras.utils.to_categorical(y_train, num_classes)\ny_test = keras.utils.to_categorical(y_test, num_classes)\n\nmodel = Sequential()\nmodel.add(Dense(512, activation='relu', input_shape=(784,)))\nmodel.add(Dropout(0.2))\nmodel.add(Dense(512, activation='relu'))\nmodel.add(Dropout(0.2))\nmodel.add(Dense(num_classes, activation='softmax'))\n\nmodel.summary()\n\nmodel.compile(loss='categorical_crossentropy',\n optimizer=RMSprop(),\n metrics=['accuracy'])\n\nhistory = model.fit(x_train, y_train,\n batch_size=batch_size,\n epochs=epochs,\n verbose=1,\n validation_data=(x_test, y_test))\nscore = model.evaluate(x_test, y_test, verbose=0)\nprint('Test loss:', score[0])\nprint('Test accuracy:', score[1])","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python","editOnDblClick":false}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785660_-795873850","id":"20171206-185615_1661505310","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:09:36+0000","dateFinished":"2017-12-08T21:10:02+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:976"},{"text":"%pyspark\n\ndir(skilContext)","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python"}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785663_-795489101","id":"20171206-190402_76171807","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:09:37+0000","dateFinished":"2017-12-08T21:10:02+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:977"},{"text":"%pyspark\n\nmodel_id = skilContext.addModelToExperiment(z, model, 'mnist_jp_5epoch')","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python"}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785663_-795489101","id":"20171206-190427_97536308","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:10:02+0000","dateFinished":"2017-12-08T21:10:02+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:978"},{"text":"%pyspark\n\nskilContext.addEvaluationToModel(z, model_id, model, x_test, y_test, name=\"kears_5_epoch\")","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python"}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785663_-795489101","id":"20171206-190604_197225742","dateCreated":"2017-12-08T20:59:45+0000","dateStarted":"2017-12-08T21:10:02+0000","dateFinished":"2017-12-08T21:11:01+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:979"},{"text":"%pyspark\n","user":"admin","dateUpdated":"2017-12-08T21:09:36+0000","config":{"colWidth":12,"editorMode":"ace/mode/python","results":{},"enabled":true,"editorSetting":{"language":"python"}},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1512766785664_-711229092","id":"20171206-190658_1479165937","dateCreated":"2017-12-08T20:59:45+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:980"}],"name":"pynote","id":"2D2W8TZD8","angularObjects":{"2CYWWXD1H:existing_process":[],"2D3K8RU6A:existing_process":[],"2D3NWDPBE:existing_process":[],"2D2UDVDJ7:existing_process":[],"2D2KBMQAR:existing_process":[],"2D39QQF26:existing_process":[],"2D3CZDZX2:existing_process":[],"2D1NNPN2U:existing_process":[]},"config":{"looknfeel":"default","personalizedMode":"false"},"info":{}}