code: def __init__(self, num_steps):
      self.num_steps = num_steps
  
      # Use keep_prob 1.0 at evaluation
      self.keep_prob = 0.9
      self.vocab_size = 793470 + FLAGS.oov_bucket_size
      self.emb_size = 512
      self.state_size = 2048
      self.projected_size = 512
  
      # Use num_sampled 0 (full softmax) at evaluation
      self.num_sampled = 8192
      self.global_step = 0
  
      self.emb = tf.Variable(
          tf.random.uniform([self.vocab_size, self.emb_size]),
          name="emb",
          trainable=True,
          dtype=tf.float32,
      )
      self.softmax_w = tf.Variable(
          tf.random.uniform([self.vocab_size, self.projected_size]),
          name="softmax_w",
          trainable=True,
          dtype=tf.float32,
      )
      self.softmax_b = tf.Variable(
          tf.zeros([self.vocab_size]),
          name="softmax_b",
          trainable=True,
          dtype=tf.float32,
      )
      self.W = tf.Variable(
          tf.zeros(
              [self.emb_size + self.projected_size, 4 * self.state_size]
          ),
          name="W",
          trainable=True,
          dtype=tf.float32,
      )
      self.B = tf.Variable(
          tf.zeros([4 * self.state_size]),
          name="B",
          trainable=True,
          dtype=tf.float32,
      )
      self.W_P = tf.Variable(
          tf.zeros([self.state_size, self.projected_size]),
          name="W_P",
          trainable=True,
          dtype=tf.float32,
      )
      major_version, _, _ = tf.version.VERSION.split(".")
      if major_version == "1":
          # self.optimizer = tf.train.AdagradOptimizer(learning_rate=0.2)
          self.optimizer = tf.train.GradientDescentOptimizer(
              learning_rate=FLAGS.learning_rate
          )
      else:
          # self.optimizer = tf.optimizers.Adagrad(FLAGS.learning_rate, initial_accumulator_value=1.0)
          self.optimizer = tf.optimizers.SGD(lr=FLAGS.learning_rate)
      self.c = np.zeros(
          [FLAGS.batch_size, self.state_size], dtype=np.float32
      )
      self.h = np.zeros(
          [FLAGS.batch_size, self.projected_size], dtype=np.float32
      )
  
file_path: autodist/examples/lm1b/language_model.py
imports: import os
  import numpy
  import tensorflow
  from absl import flags
label_desc: Use image node_id 1 to create a new LM object  with example: obj = LM(num_steps)