code: def test_fit_use_all_losses():
      """Test fitting a KerasModel and getting a loss curve back."""
      n_data_points = 10
      n_features = 2
      X = np.random.rand(n_data_points, n_features)
      y = (X[:, 0] > X[:, 1]).astype(np.float32)
      dataset = dc.data.NumpyDataset(X, y)
      keras_model = tf.keras.Sequential(
          [
              tf.keras.layers.Dense(10, activation="relu"),
              tf.keras.layers.Dense(1, activation="sigmoid"),
          ]
      )
      model = dc.models.KerasModel(
          keras_model,
          dc.models.losses.BinaryCrossEntropy(),
          learning_rate=0.005,
          log_frequency=10,
      )
      losses = []
      model.fit(dataset, nb_epoch=1000, all_losses=losses)
      # Each epoch is a single step for this model
      assert len(losses) == 100
      assert np.count_nonzero(np.array(losses)) == 100
  
file_path: deepchem/deepchem/models/tests/test_kerasmodel.py
imports: import os
  import math
  import deepchem
  import numpy
  import unittest
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_fit_use_all_losses() without return types