title: TypeError: 'tuple' object is not callable?
body: <p>I am trying to plot the Model accuracy and Model loss learning curves after I have successfully trained my LSTM  model to see the pattern of the learning curves (to see if its overfitting or underfitting) . The problem is the error &quot;TypeError: 'tuple' object is not callable&quot; keeps popping up. I'm a beginner when it comes to this so I'll take any advice I can get. I am using Python 3.8.8 and Numpy 1.18.1.</p>
  <p><strong>LSTM Model</strong></p>
  <pre><code>model=Sequential()
  model.add(LSTM(32, return_sequences=True, input_shape = (n_time_steps, n_features),
                kernel_regularizer = l2(0.000001), bias_regularizer = l2(0.000001), name='lstm_1'))
  model.add(Flatten(name='flatten'))
  model.add(Dense(64, activation='relu',kernel_regularizer = l2(0.000001), bias_regularizer = l2(0.000001), name='dense_1' ))
  model.add(Dense(len(np.unique(y_train)), activation='softmax', 
                  kernel_regularizer = l2(0.000001), bias_regularizer = l2(0.000001), name='output'))
  model.summary()
  
  # Compile the model
  model.compile(loss='sparse_categorical_crossentropy', optimizer = Adam(), metrics=['accuracy'])
  </code></pre>
  <p><strong>Model Fitting:</strong></p>
  <pre><code>history = model.fit(train_gen, epochs = 5, validation_data= test_gen, callbacks=callbacks)
  </code></pre>
  <p><strong>Learning Curves:</strong></p>
  <pre><code>def plot_learningCurve(history, epochs):
    # Plot training &amp; validation accuracy values
    epoch_range = range(1, epochs+1)
    plt.plot(epoch_range, history.history['accuracy'])
    plt.plot(epoch_range, (history.history['val_accuracy']))
    plt.title('Model accuracy')
    plt.ylabel('Accuracy')
    plt.xlabel('Epoch')
    plt.legend(['Train', 'Val'], loc='upper left')
    plt.show()
  
    # Plot training &amp; validation loss values
    plt.plot(epoch_range, history.history['loss'])
    plt.plot(epoch_range, history.history['val_loss'])
    plt.title('Model loss')
    plt.ylabel('Loss')
    plt.xlabel('Epoch')
    plt.legend(['Train', 'Val'], loc='upper left')
    plt.show()
  
  plot_learningCurve(history,5)
  </code></pre>
  <p><strong>The error:</strong></p>
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-66-f70f77d7b751&gt; in &lt;module&gt;
  ----&gt; 1 plot_learningCurve(history,5)
  
  &lt;ipython-input-65-ece94f9461ab&gt; in plot_learningCurve(history, epochs)
        2   # Plot training &amp; validation accuracy values
        3   epoch_range = range(1, epochs+1)
  ----&gt; 4   plt.plot(epoch_range, history.history['accuracy'])
        5   plt.plot(epoch_range, (history.history['val_accuracy']))
        6   plt.title('Model accuracy')
  
  TypeError: 'tuple' object is not callable
  </code></pre>