tensorflow Multidimensional softmax Creating a Softmax Output Layer

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

When state_below is a 2D Tensor, U is a 2D weights matrix, b is a class_size-length vector:

logits = tf.matmul(state_below, U) + b
return tf.nn.softmax(logits)

When state_below is a 3D tensor, U, b as before:

def softmax_fn(current_input):
    logits = tf.matmul(current_input, U) + b
    return tf.nn.softmax(logits)

raw_preds = tf.map_fn(softmax_fn, state_below)


Got any tensorflow Question?