class_docstr: Test memory efficient FP16 implementation.
class_docstr_tok: ["Test","memory","efficient","FP16","implementation","."]
code: def test_adam(self):
      valid, _ = testing_utils.train_model(
          dict(
              task="integration_tests:candidate",
              model="transformer/ranker",
              optimizer="adam",
              fp16=True,
              fp16_impl="mem_efficient",
              learningrate=7e-3,
              batchsize=32,
              num_epochs=0.25,
              n_layers=1,
              n_heads=1,
              ffn_size=32,
              embedding_size=32,
              warmup_updates=1,
              lr_scheduler="invsqrt",
          )
      )
      self.assertGreaterEqual(valid["hits@1"], 0.1)
  
file_path: ParlAI/tests/test_mem_efficient_fp16.py
imports: import os
  import unittest
  import parlai.utils.testing
label_desc: Use image node_id 1 for calling the TestMemEfficientFP16 obj's underlying member method code with example usage: obj.test_adam() without return types