title: How do you set the Adam optimizer learning rate in tensorflow.js?
body: <p>For tensorflow.js, how do you set the learning rate for the Adam optimizer in node.js?  I get an error: </p>
  
  <blockquote>
    <p>model.optimizer.setLearningRate is not a function</p>
  </blockquote>
  
  <pre><code>const optimizer = tf.train.adam(0.001)
  model.compile({
      loss: 'sparseCategoricalCrossentropy',
      optimizer,
      shuffle: true,
      metrics: ['accuracy']
  });
  
  await model.fit(trainValues, trainLabels, {
      epochs: 50,
      validationData: [testValues, testLabels],
      callbacks: {
          onEpochBegin: async (epoch) =&gt; {
              const newRate = getNewRate();
              model.optimizer.setLearningRate(newRate);
          }
      }
  });
  </code></pre>