Home | History | Annotate | Download | only in V1_0
      1 # model
      2 model = Model()
      3 
      4 i1 = Input("input", "TENSOR_FLOAT32", "{2, 5}") # batch = 2, depth = 5
      5 beta = Float32Scalar("beta", 1.)
      6 output = Output("output", "TENSOR_FLOAT32", "{2, 5}")
      7 
      8 # model 1
      9 model = model.Operation("SOFTMAX", i1, beta).To(output)
     10 
     11 # Example 1. Input in operand 0,
     12 input0 = {i1:
     13           [1., 2., 3., 4., 5.,
     14            -1., -2., -3., -4., -5.]}
     15 
     16 output0 = {output:
     17            [0.011656231, 0.031684921, 0.086128544, 0.234121657, 0.636408647,
     18             0.636408647, 0.234121657, 0.086128544, 0.031684921, 0.011656231]}
     19 
     20 # Instantiate an example
     21 Example((input0, output0))
     22