code: def create_network_return_loss(
      self, inputs, expected_output, dropout=False
  ):
      out = self(inputs, dropout)
      loss = dy.pickneglogsoftmax(out, expected_output)
      # loss = -dy.log(dy.pick(out, expected_output))
      return loss
  
file_path: dynet/examples/mnist/basic-mnist-benchmarks/mnist_dynet_autobatch.py
imports: from __future__ import division
  import os
  import struct
  import argparse
  import random
  import time
  import numpy
  import dynet
label_desc: Use image node_id 3 for calling the mnist_network obj's underlying member method code with example usage: obj.create_network_return_loss(inputs, expected_output, dropout) and returns: loss