def __init__(self, name = "Simple Recurrent Network", verbosity = 0):
        """
        Constructor for SRN sub-class. Support for sequences and prediction added.
        """
        BackpropNetwork.__init__(self, name=name, verbosity=verbosity)
        self.sequenceType = None # You will need to set this!
        # It should be one or the other:
        # self.sequenceType = "ordered-continuous"    
        self.orderedInputs = 1           
        self.initContext = 0             
        # self.sequenceType = "random-segmented":
        # self.orderedInputs = 0
        # self.initContext = 1
        # self.sequenceType = "random-continuous":
        # self.orderedInputs = 0
        # self.initContext = 0
        # self.sequenceType = "ordered-segmented":
        # self.orderedInputs = 1
        # self.initContext = 1
        # Other options:
        self.learnDuringSequence = 1
        self.contextCopying = 1
        # Internal stuff:
        self.prediction = []
        self.contextLayers = {} # records layer reference and associated hidden layer
def __init__ ( self , name = "Simple Recurrent Network" , verbosity = 0 ) : BackpropNetwork . __init__ ( self , name = name , verbosity = verbosity ) self . sequenceType = None self . orderedInputs = 1 self . initContext = 0 self . learnDuringSequence = 1 self . contextCopying = 1 self . prediction = [ ] self . contextLayers = { }
Constructor for SRN sub-class. Support for sequences and prediction added.