title: Keras Tutorial Error: NameError: name 'layers' is not defined
body: <p>I am trying to follow <a href="https://www.tensorflow.org/guide/keras" rel="nofollow noreferrer">this</a> Keras tutorial, but I encounter the following error when compiling using the command <code>python3 test.py</code>:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 13, in &lt;module&gt;
      layers.Dense(64, activation='sigmoid')
  NameError: name 'layers' is not defined
  </code></pre>
  
  <p>My code is as follows:</p>
  
  <pre><code>import tensorflow as tf
  from tensorflow import keras
  
  model = keras.Sequential()
  # Adds a densely-connected layer with 64 units to the model:
  model.add(keras.layers.Dense(64, activation='relu'))
  # Add another:
  model.add(keras.layers.Dense(64, activation='relu'))
  # Add a softmax layer with 10 output units:
  model.add(keras.layers.Dense(10, activation='softmax'))
  
  # Create a sigmoid layer:
  layers.Dense(64, activation='sigmoid')
  
  # A linear layer with L1 regularization of factor 0.01 applied to the kernel matrix:
  layers.Dense(64, kernel_regularizer=keras.regularizers.l1(0.01))
  # A linear layer with L2 regularization of factor 0.01 applied to the bias vector:
  layers.Dense(64, bias_regularizer=keras.regularizers.l2(0.01))
  
  # A linear layer with a kernel initialized to a random orthogonal matrix:
  layers.Dense(64, kernel_initializer='orthogonal')
  </code></pre>
  
  <p>Python version: 3.6.6</p>
  
  <p>Operating System: MacOS High Sierra</p>
  
  <p>I am also doing this all in the command line <code>(tensorflow)$</code> environment.</p>