6bc6978ad31c2adda4540f059340dc61ce4fde3c,src/spn/experiments/RandomSPNs/train_mnist.py,,,#,65

Before Change


    for node in output_nodes:
        simple_output.append(inference.likelihood(node, dummy_input))
    simple_output = np.stack(simple_output)
    relative_error = simple_output / np.exp(tf_output)
    print(np.average(relative_error) - 1)


    // (train_im, train_labels), _ = load_mnist()

After Change


    train_spn(spn, train_im, train_labels, num_epochs=3, sess=sess)

    // dummy_input = np.random.normal(0.0, 1.2, [10, 9])
    dummy_input = train_im[:5]
    input_ph = tf.placeholder(tf.float32, dummy_input.shape)
    output_tensor = spn.forward(input_ph)
    tf_output = sess.run(output_tensor, feed_dict={input_ph: dummy_input})

    output_nodes = spn.get_simple_spn(sess)
    simple_output = []
    for node in output_nodes:
        simple_output.append(inference.log_likelihood(node, dummy_input)[:, 0])
    // graphics.plot_spn2(output_nodes[0])
    // graphics.plot_spn_to_svg(output_nodes[0])
    simple_output = np.stack(simple_output, axis=-1)
    print(tf_output, simple_output)
    simple_output = softmax(simple_output, axis=1)
    tf_output = softmax(tf_output, axis=1) + 1e-100
    print(tf_output, simple_output)
    relative_error = np.abs(simple_output / tf_output - 1)
    print(np.average(relative_error))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: SPFlow/SPFlow
Commit Name: 6bc6978ad31c2adda4540f059340dc61ce4fde3c
Time: 2018-09-11
Author: stelzner@cs.tu-darmstadt.de
File Name: src/spn/experiments/RandomSPNs/train_mnist.py
Class Name:
Method Name:


Project Name: SPFlow/SPFlow
Commit Name: e83c4ba2424b141f626e8fc911286b7996649c62
Time: 2018-07-16
Author: stelzner@cs.tu-darmstadt.de
File Name: src/spn/experiments/RandomSPNs/train_mnist.py
Class Name:
Method Name:


Project Name: geomstats/geomstats
Commit Name: 506b234094009d55d326f1ce957f53f15d4b65ee
Time: 2018-02-26
Author: ninamio78@gmail.com
File Name: geomstats/spd_matrices_space.py
Class Name:
Method Name: group_exp