-
-
Save triestpa/57eb4118ddff8350bef2f59b03a971e9 to your computer and use it in GitHub Desktop.
TensorFlow
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Step #100, epoch #25, avg. train loss: 0.65958\n", | |
"Step #200, epoch #50, avg. train loss: 0.61890\n", | |
"Step #300, epoch #75, avg. train loss: 0.60432\n", | |
"Step #400, epoch #100, avg. train loss: 0.57985\n", | |
"Step #500, epoch #125, avg. train loss: 0.55417\n", | |
"Step #600, epoch #150, avg. train loss: 0.52275\n", | |
"Step #700, epoch #175, avg. train loss: 0.50493\n", | |
"Step #800, epoch #200, avg. train loss: 0.48512\n", | |
"Step #900, epoch #225, avg. train loss: 0.47301\n", | |
"Step #1000, epoch #250, avg. train loss: 0.46723\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"0.78947368421052633" | |
] | |
}, | |
"execution_count": 24, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"tf_clf_dnn = skflow.TensorFlowDNNClassifier(hidden_units=[20, 40, 20], n_classes=2, batch_size=256, steps=1000, learning_rate=0.05)\n", | |
"tf_clf_dnn.fit(X_train, y_train)\n", | |
"tf_clf_dnn.score(X_test, y_test)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.4.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment