class_docstr: Models a lightweight neural network model with one hidden layer to
  learn a binary XOR function. See Deep Learning Book, chapter 6.1 for
  the solution with a hidden size of 2, and a MSE loss function.
class_docstr_tok: ["Models","a","lightweight","neural","network","model","with","one","hidden","layer","to","learn","a","binary","XOR","function",".","See","Deep","Learning","Book",",","chapter","6.1","for","the","solution","with","a","hidden","size","of","2",",","and","a","MSE","loss","function","."]
code: def build_model(self) -> Sequential:
      model = Sequential()
      model.add(
          Dense(
              self.context.get_hparam("hidden_size"),
              activation="sigmoid",
              input_shape=(2,),
          )
      )
      model.add(Dense(1))
      model = self.context.wrap_model(model)
      model.compile(
          self.context.wrap_optimizer(
              SGD(lr=self.context.get_hparam("learning_rate"))
          ),
          binary_crossentropy,
          metrics=[categorical_error],
      )
      return cast(Sequential, model)
  
imports: from typing import Any, List, cast
  import tensorflow
  from packaging import version
  from tensorflow.keras.layers import Dense
  from tensorflow.keras.losses import binary_crossentropy
  from tensorflow.keras.metrics import categorical_accuracy
  from tensorflow.keras.models import Sequential
  from determined import keras
  from tests.experiment.tf_utils import make_xor_data_sequences
label_desc: Use image node_id 2 for calling the XORTrial obj's underlying member method code with example usage: obj.build_model() and returns: cast