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
| [i if i is True else 'nope' for i in [True, False, True]] | |
| # [True, 'nope', True] | |
| # Notice this is a conditional expression and different from list comprehension | |
| # Which typically is `for ... if ...` | |
| # Now it's reversed and no expression for truthy condition `if x <condition> else <expression>` |
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
| i | |
| me | |
| my | |
| myself | |
| we | |
| our | |
| ours | |
| ourselves | |
| you | |
| your |
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 tensorflow as tf | |
| import numpy as np | |
| import uuid | |
| x = tf.placeholder(shape=[None, 3], dtype=tf.float32) | |
| nn = tf.layers.dense(x, 3, activation=tf.nn.sigmoid) | |
| nn = tf.layers.dense(nn, 5, activation=tf.nn.sigmoid) | |
| encoded = tf.layers.dense(nn, 2, activation=tf.nn.sigmoid) | |
| nn = tf.layers.dense(encoded, 5, activation=tf.nn.sigmoid) | |
| nn = tf.layers.dense(nn, 3, activation=tf.nn.sigmoid) |