MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / cat_entropy

Function cat_entropy

rl3/a2c/a2c.py:17–22  ·  view source on GitHub ↗
(logits)

Source from the content-addressed store, hash-verified

15
16
17def cat_entropy(logits):
18 a0 = logits - tf.reduce_max(logits, 1, keepdims=True)
19 ea0 = tf.exp(a0)
20 z0 = tf.reduce_sum(ea0, 1, keepdims=True)
21 p0 = ea0 / z0
22 return tf.reduce_sum(p0 * (tf.log(z0) - a0), 1)
23
24
25def find_trainable_variables(key):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected