|
42 | 42 | "#### Environement:\n", |
43 | 43 | "- Ubuntu 16.04\n", |
44 | 44 | "- Anaconda 5.0.1\n", |
45 | | - "- Python 3.6.2\n", |
46 | | - "- TensorFlow 0.12.1 (GPU support)" |
| 45 | + "- Python 3.6.6\n", |
| 46 | + "- TensorFlow 1.12.0 (GPU support)" |
47 | 47 | ] |
48 | 48 | }, |
49 | 49 | { |
|
65 | 65 | "import os\n", |
66 | 66 | "import tensorflow as tf\n", |
67 | 67 | "from tensorflow.contrib.layers import flatten\n", |
68 | | - "from sklearn.metrics import confusion_matrix" |
| 68 | + "from sklearn.metrics import confusion_matrix\n", |
| 69 | + "\n", |
| 70 | + "# is it using the GPU?\n", |
| 71 | + "print(tf.test.gpu_device_name())\n", |
| 72 | + "\n", |
| 73 | + "# Show current TensorFlow version\n", |
| 74 | + "tf.__version__" |
69 | 75 | ] |
70 | 76 | }, |
71 | 77 | { |
|
696 | 702 | "\n", |
697 | 703 | " # Training operation\n", |
698 | 704 | " self.one_hot_y = tf.one_hot(y, n_out)\n", |
699 | | - " self.cross_entropy = tf.nn.softmax_cross_entropy_with_logits(self.logits, self.one_hot_y)\n", |
| 705 | + " self.cross_entropy = tf.nn.softmax_cross_entropy_with_logits_v2(logits=self.logits, labels=self.one_hot_y)\n", |
700 | 706 | " self.loss_operation = tf.reduce_mean(self.cross_entropy)\n", |
701 | 707 | " self.optimizer = tf.train.AdamOptimizer(learning_rate = learning_rate)\n", |
702 | 708 | " self.training_operation = self.optimizer.minimize(self.loss_operation)\n", |
|
900 | 906 | "\n", |
901 | 907 | " # Training operation\n", |
902 | 908 | " self.one_hot_y = tf.one_hot(y, n_out)\n", |
903 | | - " self.cross_entropy = tf.nn.softmax_cross_entropy_with_logits(self.logits, self.one_hot_y)\n", |
| 909 | + " self.cross_entropy = tf.nn.softmax_cross_entropy_with_logits_v2(logits=self.logits, labels=self.one_hot_y)\n", |
904 | 910 | " self.loss_operation = tf.reduce_mean(self.cross_entropy)\n", |
905 | 911 | " self.optimizer = tf.train.AdamOptimizer(learning_rate = learning_rate)\n", |
906 | 912 | " self.training_operation = self.optimizer.minimize(self.loss_operation)\n", |
|
1491 | 1497 | "name": "python", |
1492 | 1498 | "nbconvert_exporter": "python", |
1493 | 1499 | "pygments_lexer": "ipython3", |
1494 | | - "version": "3.5.2" |
| 1500 | + "version": "3.6.6" |
1495 | 1501 | }, |
1496 | 1502 | "widgets": { |
1497 | 1503 | "state": {}, |
|
0 commit comments