Exemple #1
0
# ----------------------------------------------------------------------

from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
import numpy
"""
This script plots different activation and decay functions and saves the 
resulting figures to a pdf document "excitation_decay_functions.pdf"
"""
with PdfPages('excitation_decay_functions.pdf') as pdf:

    plt.figure()
    plt.subplot(2, 2, 1)
    from union_temporal_pooling.activation.excite_functions.excite_functions_all import (
        LogisticExciteFunction)
    self = LogisticExciteFunction()
    self.plot()
    plt.xlabel('Predicted Input #')

    from union_temporal_pooling.activation.decay_functions.decay_functions_all import (
        ExponentialDecayFunction)

    plt.subplot(2, 2, 2)
    self = ExponentialDecayFunction(10.0)
    self.plot()
    pdf.savefig()
    plt.close()

    # from union_temporal_pooling.activation.decay_functions.logistic_decay_function import (
    #   LogisticDecayFunction)
 def setUp(self):
   self.fcn = LogisticExciteFunction(xMidpoint=5, minValue=10, maxValue=20, steepness=1)