14ecf5f181a543144bb2283f40daca6236a83b62,examples/mnist/eth_ngram_mnist.py,,,#,11

Before Change



        print("\nAll activity accuracy: %.2f (last), %.2f (average), %.2f (best)" \
                        % (accuracy["all"][-1], np.mean(accuracy["all"]), np.max(accuracy["all"])))
        print("Proportion weighting accuracy: %.2f (last), %.2f (average), %.2f (best)\n" \
                        % (accuracy["proportion"][-1], np.mean(accuracy["proportion"]),
                          np.max(accuracy["proportion"])))


        // Assign labels to excitatory layer neurons.
        assignments, proportions, rates = assign_labels(spike_record, labels[i - update_interval:i], 10, rates)

After Change


        accuracy["proportion"].append(100 * torch.sum(labels[i - update_interval:i].long() \
                                                == proportion_pred) / update_interval)

        accuracy["ngram"].append(100 * torch.sum(labels[i - update_interval:i].long() \
                                                == n_gram_pred) / update_interval)

        for eval in ["all", "proportion", "ngram"]:
            print(f"All activity accuracy: {accuracy[eval][-1]} (last), {np.mean(accuracy[eval])} (average), \
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: BindsNET/bindsnet
Commit Name: 14ecf5f181a543144bb2283f40daca6236a83b62
Time: 2018-06-18
Author: hqkhan@umass.edu
File Name: examples/mnist/eth_ngram_mnist.py
Class Name:
Method Name:


Project Name: pytorch/examples
Commit Name: 77a6ec73c53c5cc62a2ae451694537144afa5644
Time: 2016-09-14
Author: alerer@fb.com
File Name: mnist/main.py
Class Name:
Method Name: test