code: def test_multi_label_sens_spec(self):
      with self.cached_session():
          # answer calculated by hand -
          predicted = tf.constant(
              [[0, 1, 0], [0, 0, 1]], dtype=tf.float32, name="predicted"
          )
          labels = tf.constant([1, 2], dtype=tf.int64, name="labels")
          predicted, labels = [
              tf.expand_dims(x, axis=0) for x in (predicted, labels)
          ]
  
          test_loss_func = LossFunction(
              3, loss_type="SensSpec", loss_func_params={"r": 0.05}
          )
          test_loss = test_loss_func(predicted, labels)
          self.assertAlmostEqual(test_loss.eval(), 0.14598623)
  
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.loss_segmentation import LossFunction, labels_to_one_hot
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 2 for calling the SensitivitySpecificityTests obj's underlying member method code with example usage: obj.test_multi_label_sens_spec() without return types