コード例 #1
0
    def __init__(self):
        super(Sim, self).__init__()
        self.SpatToObj = float(2)
        self.SetTags("SpatToObj", 'def:"2" desc:"spatial to object projection WtScale.Rel strength -- reduce to 1.5, 1 to test"')
        self.V1ToSpat1 = float(0.6)
        self.SetTags("V1ToSpat1", 'def:"0.6" desc:"V1 to Spat1 projection WtScale.Rel strength -- reduce to .55, .5 to test"')
        self.KNaAdapt = False
        self.SetTags("KNaAdapt", 'def:"false" desc:"sodium (Na) gated potassium (K) channels that cause neurons to fatigue over time"')
        self.CueDur = int(100)
        self.SetTags("CueDur", 'def:"100" desc:"number of cycles to present the cue -- 100 by default, 50 to 300 for KNa adapt testing"')
        self.Net = leabra.Network()
        self.SetTags("Net", 'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"')
        self.Test = TestType.MultiObjs
        self.SetTags("Test", 'desc:"select which type of test (input patterns) to use"')
        self.MultiObjs = etable.Table()
        self.SetTags("MultiObjs", 'view:"no-inline" desc:"click to see these testing input patterns"')
        self.StdPosner = etable.Table()
        self.SetTags("StdPosner", 'view:"no-inline" desc:"click to see these testing input patterns"')
        self.ClosePosner = etable.Table()
        self.SetTags("ClosePosner", 'view:"no-inline" desc:"click to see these testing input patterns"')
        self.ReversePosner = etable.Table()
        self.SetTags("ReversePosner", 'view:"no-inline" desc:"click to see these testing input patterns"')
        self.ObjAttn = etable.Table()
        self.SetTags("ObjAttn", 'view:"no-inline" desc:"click to see these testing input patterns"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog", 'view:"no-inline" desc:"testing trial-level log data -- click to see record of network\'s response to each input"')
        self.TstStats = etable.Table()
        self.SetTags("TstStats", 'view:"no-inline" desc:"aggregate stats on testing data"')
        self.Params = params.Sets()
        self.SetTags("Params", 'view:"no-inline" desc:"full collection of param sets -- not really interesting for this model"')
        self.ParamSet = str()
        self.SetTags("ParamSet", 'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"')
        self.TestEnv = env.FixedTable()
        self.SetTags("TestEnv", 'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewUpdt = leabra.TimeScales.FastSpike
        self.SetTags("ViewUpdt", 'desc:"at what time scale to update the display during testing?  Change to AlphaCyc to make display updating go faster"')
        self.TstRecLays = go.Slice_string(["Input", "V1", "Spat1", "Spat2", "Obj1", "Obj2", "Output"])
        self.SetTags("TstRecLays", 'desc:"names of layers to record activations etc of during testing"')

        # internal state - view:"-"
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.vp  = 0 
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #2
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Net = leabra.Network()
        self.SetTags("Net", 'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"')
        self.Pats = etable.Table()
        self.SetTags("Pats", 'view:"no-inline" desc:"click to see the full face testing input patterns to use"')
        self.PartPats = etable.Table()
        self.SetTags("PartPats", 'view:"no-inline" desc:"click to see the partial face testing input patterns to use"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog", 'view:"no-inline" desc:"testing trial-level log data -- click to see record of network\'s response to each input"')
        self.PrjnTable = etable.Table()
        self.SetTags("PrjnTable", 'view:"no-inline" desc:"projection of testing data"')
        self.Params = params.Sets()
        self.SetTags("Params", 'view:"no-inline" desc:"full collection of param sets -- not really interesting for this model"')
        self.ParamSet = str()
        self.SetTags("ParamSet", 'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"')
        self.TestEnv = env.FixedTable()
        self.SetTags("TestEnv", 'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewUpdt = leabra.TimeScales.Cycle
        self.SetTags("ViewUpdt", 'desc:"at what time scale to update the display during testing?  Change to AlphaCyc to make display updating go faster"')
        self.TstRecLays = go.Slice_string(["Input", "Emotion", "Gender", "Identity"])
        self.SetTags("TstRecLays", 'desc:"names of layers to record activations etc of during testing"')
        self.ClustFaces = eplot.Plot2D()
        self.SetTags("ClustFaces", 'view:"no-inline" desc:"cluster plot of faces"')
        self.ClustEmote = eplot.Plot2D()
        self.SetTags("ClustEmote", 'view:"no-inline" desc:"cluster plot of emotions"')
        self.ClustGend = eplot.Plot2D()
        self.SetTags("ClustGend", 'view:"no-inline" desc:"cluster plot of genders"')
        self.ClustIdent = eplot.Plot2D()
        self.SetTags("ClustIdent", 'view:"no-inline" desc:"cluster plot of identity"')
        self.PrjnRandom = eplot.Plot2D()
        self.SetTags("PrjnRandom", 'view:"no-inline" desc:"random projection plot"')
        self.PrjnEmoteGend = eplot.Plot2D()
        self.SetTags("PrjnEmoteGend", 'view:"no-inline" desc:"projection plot of emotions & gender"')

        # internal state - view:"-"
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.vp  = 0 
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #3
0
ファイル: detector.py プロジェクト: mewbak/axon
    def __init__(self):
        super(Sim, self).__init__()
        self.GbarL = float(2.0)
        self.SetTags("GbarL", 'def:"2" min:"0" max:"4" step:"0.05" desc:"the leak conductance, which pulls against the excitatory input conductance to determine how hard it is to activate the receiving unit"')
        self.Net = leabra.Network()
        self.SetTags("Net", 'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"')
        self.Pats = etable.Table()
        self.SetTags("Pats", 'view:"no-inline" desc:"click to see the testing input patterns to use (digits)"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog", 'view:"no-inline" desc:"testing trial-level log data -- click to see record of network\'s response to each input"')
        self.Params = params.Sets()
        self.ParamSet = str()
        self.SetTags("ParamSet", 'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"')
        self.SetTags("Params", 'view:"no-inline" desc:"full collection of param sets -- not really interesting for this model"')
        self.TestEnv = env.FixedTable()
        self.SetTags("TestEnv", 'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewUpdt = leabra.TimeScales.Cycle
        self.SetTags("ViewUpdt", 'desc:"at what time scale to update the display during testing?  Change to AlphaCyc to make display updating go faster"')

        # internal state - view:"-"
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.vp  = 0 
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #4
0
    def __init__(self):
        super(Sim, self).__init__()
        self.ExcitLateralScale = float(0.2)
        self.SetTags(
            "ExcitLateralScale",
            'def:"0.2" desc:"excitatory lateral (recurrent) WtScale.Rel value"'
        )
        self.InhibLateralScale = float(0.2)
        self.SetTags(
            "InhibLateralScale",
            'def:"0.2" desc:"inhibitory lateral (recurrent) WtScale.Abs value"'
        )
        self.ExcitLateralLearn = True
        self.SetTags(
            "ExcitLateralLearn",
            'def:"true" desc:"do excitatory lateral (recurrent) connections learn?"'
        )
        self.Net = leabra.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.Probes = etable.Table()
        self.SetTags("Probes", 'view:"no-inline" desc:"probe inputs"')
        self.TrnEpcLog = etable.Table()
        self.SetTags("TrnEpcLog",
                     'view:"no-inline" desc:"training epoch-level log data"')
        self.TstEpcLog = etable.Table()
        self.SetTags("TstEpcLog",
                     'view:"no-inline" desc:"testing epoch-level log data"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog",
                     'view:"no-inline" desc:"testing trial-level log data"')
        self.RunLog = etable.Table()
        self.SetTags("RunLog",
                     'view:"no-inline" desc:"summary log of each run"')
        self.RunStats = etable.Table()
        self.SetTags("RunStats",
                     'view:"no-inline" desc:"aggregate stats on all runs"')
        self.Params = params.Sets()
        self.SetTags("Params",
                     'view:"no-inline" desc:"full collection of param sets"')
        self.ParamSet = str()
        self.SetTags(
            "ParamSet",
            'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"'
        )
        self.V1onWts = etensor.Float32()
        self.SetTags("V1onWts",
                     'view:"-" desc:"weights from input to V1 layer"')
        self.V1offWts = etensor.Float32()
        self.SetTags("V1offWts",
                     'view:"-" desc:"weights from input to V1 layer"')
        self.V1Wts = etensor.Float32()
        self.SetTags(
            "V1Wts",
            'view:"no-inline" desc:"net on - off weights from input to V1 layer"'
        )
        self.MaxRuns = int(1)
        self.SetTags("MaxRuns",
                     'desc:"maximum number of model runs to perform"')
        self.MaxEpcs = int(100)
        self.SetTags("MaxEpcs",
                     'desc:"maximum number of epochs to run per model run"')
        self.MaxTrls = int(100)
        self.SetTags("MaxTrls",
                     'desc:"maximum number of training trials per epoch"')
        self.NZeroStop = int(-1)
        self.SetTags(
            "NZeroStop",
            'desc:"if a positive number, training will stop after this many epochs with zero SSE"'
        )
        self.TrainEnv = ImgEnv()
        self.SetTags("TrainEnv",
                     'desc:"Training environment -- visual images"')
        self.TestEnv = env.FixedTable()
        self.SetTags(
            "TestEnv",
            'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewOn = True
        self.SetTags(
            "ViewOn",
            'desc:"whether to update the network view while running"')
        self.TrainUpdt = leabra.TimeScales.AlphaCycle
        self.SetTags(
            "TrainUpdt",
            'desc:"at what time scale to update the display during training?  Anything longer than Epoch updates at Epoch in this model"'
        )
        self.TestUpdt = leabra.TimeScales.Cycle
        self.SetTags(
            "TestUpdt",
            'desc:"at what time scale to update the display during testing?  Anything longer than Epoch updates at Epoch in this model"'
        )
        self.LayStatNms = go.Slice_string(["V1"])
        self.SetTags(
            "LayStatNms",
            'desc:"names of layers to collect more detailed stats on (avg act, etc)"'
        )

        # statistics: note use float64 as that is best for etable.Table
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.CurImgGrid = 0
        self.SetTags("CurImgGrid",
                     'view:"-" desc:"the current image grid view"')
        self.WtsGrid = 0
        self.SetTags("WtsGrid", 'view:"-" desc:"the weights grid view"')
        self.TrnEpcPlot = 0
        self.SetTags("TrnEpcPlot", 'view:"-" desc:"the training epoch plot"')
        self.TstEpcPlot = 0
        self.SetTags("TstEpcPlot", 'view:"-" desc:"the testing epoch plot"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.RunPlot = 0
        self.SetTags("RunPlot", 'view:"-" desc:"the run plot"')
        self.TrnEpcFile = 0
        self.SetTags("TrnEpcFile", 'view:"-" desc:"log file"')
        self.RunFile = 0
        self.SetTags("RunFile", 'view:"-" desc:"log file"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.NeedsNewRun = False
        self.SetTags(
            "NeedsNewRun",
            'view:"-" desc:"flag to initialize NewRun if last one finished"')
        self.RndSeed = int(1)
        self.SetTags("RndSeed", 'view:"-" desc:"the current random seed"')
        self.vp = 0
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #5
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Net = leabra.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.Learn = LearnType.Hebbian
        self.SetTags("Learn", 'desc:"select which type of learning to use"')
        self.Pats = PatsType.Easy
        self.SetTags("Pats", 'desc:"select which type of patterns to use"')
        self.Easy = etable.Table()
        self.SetTags(
            "Easy",
            'view:"no-inline" desc:"easy training patterns -- can be learned with Hebbian"'
        )
        self.Hard = etable.Table()
        self.SetTags(
            "Hard",
            'view:"no-inline" desc:"hard training patterns -- require error-driven"'
        )
        self.Impossible = etable.Table()
        self.SetTags(
            "Impossible",
            'view:"no-inline" desc:"impossible training patterns -- require error-driven + hidden layer"'
        )
        self.TrnEpcLog = etable.Table()
        self.SetTags("TrnEpcLog",
                     'view:"no-inline" desc:"training epoch-level log data"')
        self.TstEpcLog = etable.Table()
        self.SetTags("TstEpcLog",
                     'view:"no-inline" desc:"testing epoch-level log data"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog",
                     'view:"no-inline" desc:"testing trial-level log data"')
        self.RunLog = etable.Table()
        self.SetTags("RunLog",
                     'view:"no-inline" desc:"summary log of each run"')
        self.RunStats = etable.Table()
        self.SetTags("RunStats",
                     'view:"no-inline" desc:"aggregate stats on all runs"')
        self.Params = params.Sets()
        self.SetTags("Params",
                     'view:"no-inline" desc:"full collection of param sets"')
        self.ParamSet = str()
        self.SetTags(
            "ParamSet",
            'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set"'
        )
        self.MaxRuns = int(10)
        self.SetTags("MaxRuns",
                     'desc:"maximum number of model runs to perform"')
        self.MaxEpcs = int(40)
        self.SetTags("MaxEpcs",
                     'desc:"maximum number of epochs to run per model run"')
        self.NZeroStop = int(5)
        self.SetTags(
            "NZeroStop",
            'desc:"if a positive number, training will stop after this many epochs with zero SSE"'
        )
        self.TrainEnv = env.FixedTable()
        self.SetTags(
            "TrainEnv",
            'desc:"Training environment -- contains everything about iterating over input / output patterns over training"'
        )
        self.TestEnv = env.FixedTable()
        self.SetTags(
            "TestEnv",
            'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewOn = True
        self.SetTags(
            "ViewOn",
            'desc:"whether to update the network view while running"')
        self.TrainUpdt = leabra.TimeScales.AlphaCycle
        self.SetTags(
            "TrainUpdt",
            'desc:"at what time scale to update the display during training?  Anything longer than Epoch updates at Epoch in this model"'
        )
        self.TestUpdt = leabra.TimeScales.Cycle
        self.SetTags(
            "TestUpdt",
            'desc:"at what time scale to update the display during testing?  Anything longer than Epoch updates at Epoch in this model"'
        )
        self.TestInterval = int(5)
        self.SetTags(
            "TestInterval",
            'desc:"how often to run through all the test patterns, in terms of training epochs -- can use 0 or -1 for no testing"'
        )
        self.LayStatNms = go.Slice_string(["Input", "Output"])
        self.SetTags(
            "LayStatNms",
            'desc:"names of layers to collect more detailed stats on (avg act, etc)"'
        )

        # statistics: note use float64 as that is best for etable.Table
        self.TrlErr = float(0)
        self.SetTags(
            "TrlErr",
            'inactive:"+" desc:"1 if trial was error, 0 if correct -- based on SSE = 0 (subject to .5 unit-wise tolerance)"'
        )
        self.TrlSSE = float(0)
        self.SetTags("TrlSSE",
                     'inactive:"+" desc:"current trial\'s sum squared error"')
        self.TrlAvgSSE = float(0)
        self.SetTags(
            "TrlAvgSSE",
            'inactive:"+" desc:"current trial\'s average sum squared error"')
        self.TrlCosDiff = float(0)
        self.SetTags("TrlCosDiff",
                     'inactive:"+" desc:"current trial\'s cosine difference"')
        self.EpcSSE = float(0)
        self.SetTags(
            "EpcSSE",
            'inactive:"+" desc:"last epoch\'s total sum squared error"')
        self.EpcAvgSSE = float(0)
        self.SetTags(
            "EpcAvgSSE",
            'inactive:"+" desc:"last epoch\'s average sum squared error (average over trials, and over units within layer)"'
        )
        self.EpcPctErr = float(0)
        self.SetTags("EpcPctErr",
                     'inactive:"+" desc:"last epoch\'s average TrlErr"')
        self.EpcPctCor = float(0)
        self.SetTags("EpcPctCor",
                     'inactive:"+" desc:"1 - last epoch\'s average TrlErr"')
        self.EpcCosDiff = float(0)
        self.SetTags(
            "EpcCosDiff",
            'inactive:"+" desc:"last epoch\'s average cosine difference for output layer (a normalized error measure, maximum of 1 when the minus phase exactly matches the plus)"'
        )
        self.FirstZero = int(-1)
        self.SetTags(
            "FirstZero",
            'inactive:"+" desc:"epoch at when SSE first went to zero"')
        self.NZero = int(0)
        self.SetTags(
            "NZero",
            'inactive:"+" desc:"number of epochs in a row with zero SSE"')

        # internal state - view:"-"
        self.SumErr = float(0)
        self.SetTags(
            "SumErr",
            'view:"-" inactive:"+" desc:"sum to increment as we go through epoch"'
        )
        self.SumSSE = float(0)
        self.SetTags(
            "SumSSE",
            'view:"-" inactive:"+" desc:"sum to increment as we go through epoch"'
        )
        self.SumAvgSSE = float(0)
        self.SetTags(
            "SumAvgSSE",
            'view:"-" inactive:"+" desc:"sum to increment as we go through epoch"'
        )
        self.SumCosDiff = float(0)
        self.SetTags(
            "SumCosDiff",
            'view:"-" inactive:"+" desc:"sum to increment as we go through epoch"'
        )
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TrnEpcPlot = 0
        self.SetTags("TrnEpcPlot", 'view:"-" desc:"the training epoch plot"')
        self.TstEpcPlot = 0
        self.SetTags("TstEpcPlot", 'view:"-" desc:"the testing epoch plot"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.RunPlot = 0
        self.SetTags("RunPlot", 'view:"-" desc:"the run plot"')
        self.TrnEpcFile = 0
        self.SetTags("TrnEpcFile", 'view:"-" desc:"log file"')
        self.RunFile = 0
        self.SetTags("RunFile", 'view:"-" desc:"log file"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.NeedsNewRun = False
        self.SetTags(
            "NeedsNewRun",
            'view:"-" desc:"flag to initialize NewRun if last one finished"')
        self.RndSeed = int(1)
        self.SetTags("RndSeed", 'view:"-" desc:"the current random seed"')
        self.vp = 0
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #6
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Delay = Delays.Delay3
        self.SetTags("Delay",
                     'desc:"which delay to use -- pres Init when changing"')
        self.RecurrentWt = float(0.4)
        self.SetTags(
            "RecurrentWt",
            'def:"0.4" step:"0.01" desc:"strength of recurrent weight in Hidden layer from each unit back to self"'
        )
        self.Net = leabra.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.Delay3Pats = etable.Table()
        self.SetTags("Delay3Pats", 'view:"no-inline" desc:"delay 3 patterns"')
        self.Delay5Pats = etable.Table()
        self.SetTags("Delay5Pats", 'view:"no-inline" desc:"delay 5 patterns"')
        self.Delay1Pats = etable.Table()
        self.SetTags("Delay1Pats", 'view:"no-inline" desc:"delay 1 patterns"')
        self.TrnTrlLog = etable.Table()
        self.SetTags("TrnTrlLog",
                     'view:"no-inline" desc:"testing trial-level log data"')
        self.Params = params.Sets()
        self.SetTags("Params",
                     'view:"no-inline" desc:"full collection of param sets"')
        self.ParamSet = str()
        self.SetTags(
            "ParamSet",
            'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"'
        )
        self.MaxRuns = int(1)
        self.SetTags("MaxRuns",
                     'desc:"maximum number of model runs to perform"')
        self.MaxEpcs = int(1)
        self.SetTags("MaxEpcs",
                     'desc:"maximum number of epochs to run per model run"')
        self.TrainEnv = env.FixedTable()
        self.SetTags(
            "TrainEnv",
            'desc:"Training environment -- contains everything about iterating over input / output patterns over training"'
        )
        self.Time = leabra.Time()
        self.Time.CycPerQtr = 4  # key!
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewOn = True
        self.SetTags(
            "ViewOn",
            'desc:"whether to update the network view while running"')
        self.TrainUpdt = leabra.TimeScales.Quarter
        self.SetTags(
            "TrainUpdt",
            'desc:"at what time scale to update the display during training?  Anything longer than Epoch updates at Epoch in this model"'
        )
        self.TstRecLays = go.Slice_string(
            ["Location", "Cover", "Toy", "Hidden", "GazeExpect", "Reach"])
        self.SetTags(
            "TstRecLays",
            'desc:"names of layers to record activations etc of during testing"'
        )

        # statistics: note use float64 as that is best for etable.Table
        self.PrvGpName = str()
        self.SetTags("PrvGpName", 'view:"-" desc:"previous group name"')
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TrnTrlTable = 0
        self.SetTags("TrnTrlTable",
                     'view:"-" desc:"the train trial table view"')
        self.TrnTrlPlot = 0
        self.SetTags("TrnTrlPlot", 'view:"-" desc:"the train trial plot"')
        self.RunPlot = 0
        self.SetTags("RunPlot", 'view:"-" desc:"the run plot"')
        self.TrnEpcFile = 0
        self.SetTags("TrnEpcFile", 'view:"-" desc:"log file"')
        self.RunFile = 0
        self.SetTags("RunFile", 'view:"-" desc:"log file"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.NeedsNewRun = False
        self.SetTags(
            "NeedsNewRun",
            'view:"-" desc:"flag to initialize NewRun if last one finished"')
        self.RndSeed = int(1)
        self.SetTags("RndSeed", 'view:"-" desc:"the current random seed"')
        self.vp = 0
        self.SetTags("vp", 'view:"-" desc:"viewport"')
コード例 #7
0
ファイル: self_org.py プロジェクト: mewbak/axon
    def __init__(self):
        super(Sim, self).__init__()
        self.AvgLGain = float(2.5)
        self.SetTags("AvgLGain", 'min:"0.1" step:"0.5" def:"2.5" desc:"key BCM hebbian learning parameter, that determines how high the floating threshold goes -- higher = more homeostatic pressure against rich-get-richer feedback loops"')
        self.InputNoise = float(0)
        self.SetTags("InputNoise", 'min:"0" def:"0" desc:"variance on gaussian noise to add to inputs"')
        self.TrainGi = float(1.8)
        self.SetTags("TrainGi", 'min:"0" step:"0.1" def:"1.8" desc:"strength of inhibition during training with two lines present in input"')
        self.TestGi = float(2.5)
        self.SetTags("TestGi", 'min:"0" step:"0.1" def:"2.5" desc:"strength of inhibition during testing with one line present in input -- higher because fewer neurons should be active"')
        self.Net = leabra.Network()
        self.SetTags("Net", 'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"')
        self.Lines2 = etable.Table()
        self.SetTags("Lines2", 'view:"no-inline" desc:"easy training patterns -- can be learned with Hebbian"')
        self.Lines1 = etable.Table()
        self.SetTags("Lines1", 'view:"no-inline" desc:"hard training patterns -- require error-driven"')
        self.TrnEpcLog = etable.Table()
        self.SetTags("TrnEpcLog", 'view:"no-inline" desc:"training epoch-level log data"')
        self.TstEpcLog = etable.Table()
        self.SetTags("TstEpcLog", 'view:"no-inline" desc:"testing epoch-level log data"')
        self.TstTrlLog = etable.Table()
        self.SetTags("TstTrlLog", 'view:"no-inline" desc:"testing trial-level log data"')
        self.HidFmInputWts = etensor.Float32()
        self.SetTags("HidFmInputWts", 'view:"no-inline" desc:"weights from input to hidden layer"')
        self.RunLog = etable.Table()
        self.SetTags("RunLog", 'view:"no-inline" desc:"summary log of each run"')
        self.RunStats = etable.Table()
        self.SetTags("RunStats", 'view:"no-inline" desc:"aggregate stats on all runs"')
        self.SimMat = simat.SimMat()
        self.SetTags("SimMat", 'view:"no-inline" desc:"similarity matrix"')
        self.Params = params.Sets()
        self.SetTags("Params", 'view:"no-inline" desc:"full collection of param sets"')
        self.ParamSet = str()
        self.SetTags("ParamSet", 'view:"-" desc:"which set of *additional* parameters to use -- always applies Base and optionaly this next if set -- can use multiple names separated by spaces (don\'t put spaces in ParamSet names!)"')
        self.MaxRuns = int(8)
        self.SetTags("MaxRuns", 'desc:"maximum number of model runs to perform"')
        self.MaxEpcs = int(30)
        self.SetTags("MaxEpcs", 'desc:"maximum number of epochs to run per model run"')
        self.TrainEnv = env.FixedTable()
        self.SetTags("TrainEnv", 'desc:"Training environment -- contains everything about iterating over input / output patterns over training"')
        self.TestEnv = env.FixedTable()
        self.SetTags("TestEnv", 'desc:"Testing environment -- manages iterating over testing"')
        self.Time = leabra.Time()
        self.SetTags("Time", 'desc:"leabra timing parameters and state"')
        self.ViewOn = True
        self.SetTags("ViewOn", 'desc:"whether to update the network view while running"')
        self.TrainUpdt = leabra.TimeScales.AlphaCycle
        self.SetTags("TrainUpdt", 'desc:"at what time scale to update the display during training?  Anything longer than Epoch updates at Epoch in this model"')
        self.TestUpdt = leabra.TimeScales.Cycle
        self.SetTags("TestUpdt", 'desc:"at what time scale to update the display during testing?  Anything longer than Epoch updates at Epoch in this model"')
        self.TestInterval = int(1)
        self.SetTags("TestInterval", 'desc:"how often to run through all the test patterns, in terms of training epochs"')
        self.TstRecLays = go.Slice_string(["Input", "Hidden"])
        self.SetTags("TstRecLays", 'desc:"names of layers to record activations etc of during testing"')
        self.UniqPats = float(0)
        self.SetTags("UniqPats", 'inactive:"+" desc:"number of uniquely-coded line patterns, computed during testing -- maximum 10, higher is better"')

        # internal state - view:"-"
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetView = 0
        self.SetTags("NetView", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.WtsGrid = 0
        self.SetTags("WtsGrid", 'view:"-" desc:"the weights grid view"')
        self.TrnEpcPlot = 0
        self.SetTags("TrnEpcPlot", 'view:"-" desc:"the training epoch plot"')
        self.TstEpcPlot = 0
        self.SetTags("TstEpcPlot", 'view:"-" desc:"the testing epoch plot"')
        self.TstTrlPlot = 0
        self.SetTags("TstTrlPlot", 'view:"-" desc:"the test-trial plot"')
        self.RunPlot = 0
        self.SetTags("RunPlot", 'view:"-" desc:"the run plot"')
        self.TrnEpcFile = 0
        self.SetTags("TrnEpcFile", 'view:"-" desc:"log file"')
        self.RunFile = 0
        self.SetTags("RunFile", 'view:"-" desc:"log file"')
        self.ValsTsrs = {}
        self.SetTags("ValsTsrs", 'view:"-" desc:"for holding layer values"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.StopNow = False
        self.SetTags("StopNow", 'view:"-" desc:"flag to stop running"')
        self.NeedsNewRun = False
        self.SetTags("NeedsNewRun", 'view:"-" desc:"flag to initialize NewRun if last one finished"')
        self.RndSeed = int(1)
        self.SetTags("RndSeed", 'view:"-" desc:"the current random seed"')
        self.vp  = 0 
        self.SetTags("vp", 'view:"-" desc:"viewport"')