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

Method init_random

hmm_class/hmmd_tf.py:91–96  ·  view source on GitHub ↗
(self, V)

Source from the content-addressed store, hash-verified

89 self.train_op = tf.train.AdamOptimizer(1e-2).minimize(self.cost)
90
91 def init_random(self, V):
92 preSoftmaxPi0 = np.zeros(self.M).astype(np.float32) # initial state distribution
93 preSoftmaxA0 = np.random.randn(self.M, self.M).astype(np.float32) # state transition matrix
94 preSoftmaxB0 = np.random.randn(self.M, V).astype(np.float32) # output distribution
95
96 self.build(preSoftmaxPi0, preSoftmaxA0, preSoftmaxB0)
97
98 def set(self, preSoftmaxPi, preSoftmaxA, preSoftmaxB):
99 op1 = self.preSoftmaxPi.assign(preSoftmaxPi)

Callers 1

fit_coinFunction · 0.95

Calls 1

buildMethod · 0.95

Tested by

no test coverage detected