예제 #1
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"')
예제 #2
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"')
예제 #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 py_to_etable(pt):
    """
    returns an etable.Table version of given pyet.eTable.
    """
    et = etable.Table()
    et.Rows = pt.Rows
    nc = len(pt.Cols)
    for ci in range(nc):
        pc = pt.Cols[ci]
        cn = pt.ColNames[ci]
        tsr = numpy_to_etensor(pc)
        et.AddCol(tsr, cn)
    for md in pt.MetaData:
        et.SetMetaData(md, pt.MetaData[md])
    return et
예제 #5
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Pats = etable.Table()
        self.SetTags("Pats", 'view:"no-inline" desc:"test patterns"')

        self.PatsTable = 0
        self.SetTags("PatsTable", 'view:"-" desc:"view"')

        # statistics: note use float64 as that is best for etable.Table
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.vp  = 0
        self.SetTags("vp", 'view:"-" desc:"viewport"')
예제 #6
0
    def ClustPlot(ss, plt, dt, colNm):
        """
        ClustPlot does one cluster plot on given table column
        """
        ix = etable.NewIdxView(dt)
        smat = simat.SimMat()
        smat.TableColStd(ix, colNm, "Name", False, metric.Euclidean)
        pt = etable.Table()
        clust.Plot(pt, clust.GlomStd(smat, clust.Min), smat)
        plt.InitName(plt, colNm)
        plt.Params.Title = "Cluster Plot of Faces " + colNm
        plt.Params.XAxisCol = "X"
        plt.SetTable(pt)

        plt.SetColParams("X", eplot.Off, eplot.FixMin, 0, eplot.FloatMax, 0)
        plt.SetColParams("Y", eplot.On, eplot.FixMin, 0, eplot.FloatMax, 0)
        plt.SetColParams("Label", eplot.On, eplot.FixMin, 0, eplot.FloatMax, 0)
예제 #7
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"')
예제 #8
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"')
예제 #9
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Noise = float(0.01)
        self.SetTags(
            "Noise",
            'min:"0" step:"0.01" desc:"the variance parameter for Gaussian noise added to unit activations on every cycle"'
        )
        self.KNaAdapt = False
        self.SetTags(
            "KNaAdapt",
            'desc:"apply sodium-gated potassium adaptation mechanisms that cause the neuron to reduce spiking over time"'
        )
        self.CycPerQtr = int(25)
        self.SetTags(
            "CycPerQtr",
            'def:"25,250" desc:"total number of cycles per quarter to run -- increase to 250 when testing adaptation"'
        )
        self.Net = leabra.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.TstCycLog = etable.Table()
        self.SetTags(
            "TstCycLog",
            '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.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.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(["NeckerCube"])
        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.TstCycPlot = 0
        self.SetTags("TstCycPlot", '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"')
예제 #10
0
    def __init__(self):
        super(Sim, self).__init__()
        self.BurstDaGain = float(1)
        self.SetTags(
            "BurstDaGain",
            'min:"0" step:"0.1" desc:"strength of dopamine bursts: 1 default -- reduce for PD OFF, increase for PD ON"'
        )
        self.DipDaGain = float(1)
        self.SetTags(
            "DipDaGain",
            'min:"0" step:"0.1" desc:"strength of dopamine dips: 1 default -- reduce to siulate D2 agonists"'
        )
        self.Net = pbwm.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        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.MtxInputWts = etensor.Float32()
        self.SetTags(
            "MtxInputWts",
            '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.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(30)
        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.TrainEnv = BanditEnv()
        self.SetTags("TrainEnv",
                     'desc:"Training environment -- bandit environment"')
        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.AlphaCycle
        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.TstRecLays = go.Slice_string(["MatrixGo", "MatrixNoGo"])
        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.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"')
예제 #11
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Words1 = "attention"
        self.SetTags("Words1", 'desc:"space-separated words to test the network with"')
        self.Words2 = "binding"
        self.SetTags("Words2", 'desc:"space-separated words to test the network with"')
        self.ExcitLateralScale = float(0.05)
        self.SetTags("ExcitLateralScale", 'def:"0.05" desc:"excitatory lateral (recurrent) WtScale.Rel value"')
        self.InhibLateralScale = float(0.05)
        self.SetTags("InhibLateralScale", 'def:"0.05" desc:"inhibitory lateral (recurrent) WtScale.Abs value"')
        self.ExcitLateralLearn = True
        self.SetTags("ExcitLateralLearn", 'def:"true" desc:"do excitatory lateral (recurrent) connections learn?"')
        self.WtWordsThr = float(0.75)
        self.SetTags("WtWordsThr", 'def:"0.75" desc:"threshold for weight strength for including in WtWords"')
        self.Net = leabra.Network()
        self.SetTags("Net", 'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"')
        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.TstQuizLog = etable.Table()
        self.SetTags("TstQuizLog", 'view:"no-inline" desc:"testing quiz 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.Tag = str()
        self.SetTags("Tag", 'desc:"extra tag string to add to any file names output from sim (e.g., weights files, log files, params for run)"')
        self.MaxRuns = int(1)
        self.SetTags("MaxRuns", 'desc:"maximum number of model runs to perform"')
        self.MaxEpcs = int(50)
        self.SetTags("MaxEpcs", 'desc:"maximum number of epochs to run per model run"')
        self.NZeroStop = int(-1)
        self.SetTags("NZeroStop", 'desc:"if a positive number, training will stop after this many epochs with zero SSE"')
        self.TrainEnv = SemEnv()
        self.SetTags("TrainEnv", 'desc:"Training environment -- training paragraphs"')
        self.TestEnv = SemEnv()
        self.SetTags("TestEnv", 'desc:"Testing environment -- manages iterating over testing"')
        self.QuizEnv = SemEnv()
        self.SetTags("QuizEnv", 'desc:"Quiz 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.AlphaCycle
        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(["Hidden"])
        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.TstWords = str()
        self.SetTags("TstWords", 'inactive:"+" desc:"words that were tested (short form)"')
        self.TstWordsCorrel = float()
        self.SetTags("TstWordsCorrel", 'inactive:"+" desc:"correlation between hidden pattern for Words1 vs. Words2"')
        self.TstQuizPctCor = float()
        self.SetTags("TstQuizPctCor", 'inactive:"+" desc:"proportion correct for the quiz"')
        self.EpcPerTrlMSec = float()
        self.SetTags("EpcPerTrlMSec", 'view:"-" desc:"how long did the epoch take per trial in wall-clock milliseconds"')

        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.TstQuizPlot = 0
        self.SetTags("TstQuizPlot", 'view:"-" desc:"the testing quiz 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.SaveWts = False
        self.SetTags("SaveWts", 'view:"-" desc:"for command-line run only, auto-save final weights after each run"')
        self.NoGui = False
        self.SetTags("NoGui", 'view:"-" desc:"if true, runing in no GUI mode"')
        self.LogSetParams = False
        self.SetTags("LogSetParams", 'view:"-" desc:"if true, print message for all params that are set"')
        self.IsRunning = False
        self.SetTags("IsRunning", 'view:"-" desc:"true if sim is running"')
        self.InQuiz = False
        self.SetTags("InQuiz", 'view:"-" desc:"true if in quiz"')
        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.LastEpcTime = 0
        self.SetTags("LastEpcTime", 'view:"-" desc:"timer for last epoch"')
        self.vp  = 0
        self.SetTags("vp", 'view:"-" desc:"viewport"')
예제 #12
0
파일: inhib.py 프로젝트: mewbak/axon
    def __init__(self):
        super(Sim, self).__init__()
        self.BidirNet = False
        self.SetTags(
            "BidirNet",
            'desc:"if true, use the bidirectionally-connected network -- otherwise use the simpler feedforward network"'
        )
        self.TrainedWts = False
        self.SetTags(
            "TrainedWts",
            'desc:"simulate trained weights by having higher variance and Gaussian distributed weight values -- otherwise lower variance, uniform"'
        )
        self.InputPct = float(20)
        self.SetTags(
            "InputPct",
            'def:"20" min:"5" max:"50" step:"1" desc:"percent of active units in input layer (literally number of active units, because input has 100 units total)"'
        )
        self.FFFBInhib = False
        self.SetTags(
            "FFFBInhib",
            'def:"false" desc:"use feedforward, feedback (FFFB) computed inhibition instead of unit-level inhibition"'
        )

        self.HiddenGbarI = float(0.4)
        self.SetTags(
            "HiddenGbarI",
            'def:"0.4" min:"0" step:"0.05" desc:"inhibitory conductance strength for inhibition into Hidden layer"'
        )
        self.InhibGbarI = float(0.75)
        self.SetTags(
            "InhibGbarI",
            'def:"0.75" min:"0" step:"0.05" desc:"inhibitory conductance strength for inhibition into Inhib layer (self-inhibition -- tricky!)"'
        )
        self.FFinhibWtScale = float(1.0)
        self.SetTags(
            "FFinhibWtScale",
            'def:"1" min:"0" step:"0.1" desc:"feedforward (FF) inhibition relative strength: for FF projections into Inhib neurons"'
        )
        self.FBinhibWtScale = float(1.0)
        self.SetTags(
            "FBinhibWtScale",
            'def:"1" min:"0" step:"0.1" desc:"feedback (FB) inhibition relative strength: for projections into Inhib neurons"'
        )
        self.HiddenGTau = float(40)
        self.SetTags(
            "HiddenGTau",
            'def:"40" min:"1" step:"1" desc:"time constant (tau) for updating G conductances into Hidden neurons -- much slower than std default of 1.4"'
        )
        self.InhibGTau = float(20)
        self.SetTags(
            "InhibGTau",
            'def:"20" min:"1" step:"1" desc:"time constant (tau) for updating G conductances into Inhib neurons -- much slower than std default of 1.4, but 2x faster than Hidden"'
        )
        self.FmInhibWtScaleAbs = float(1)
        self.SetTags(
            "FmInhibWtScaleAbs",
            'def:"1" desc:"absolute weight scaling of projections from inhibition onto hidden and inhib layers -- this must be set to 0 to turn off the connection-based inhibition when using the FFFBInhib computed inbhition"'
        )

        self.NetFF = leabra.Network()
        self.SetTags(
            "NetFF",
            'view:"no-inline" desc:"the feedforward network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.NetBidir = leabra.Network()
        self.SetTags(
            "NetBidir",
            'view:"no-inline" desc:"the bidirectional network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.TstCycLog = etable.Table()
        self.SetTags(
            "TstCycLog",
            '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.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.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(["Hidden", "Inhib"])
        self.SetTags(
            "TstRecLays",
            'desc:"names of layers to record activations etc of during testing"'
        )
        self.Pats = etable.Table()
        self.SetTags(
            "Pats",
            'view:"no-inline" desc:"the input patterns to use -- randomly generated"'
        )

        # internal state - view:"-"
        self.Win = 0
        self.SetTags("Win", 'view:"-" desc:"main GUI window"')
        self.NetViewFF = 0
        self.SetTags("NetViewFF", 'view:"-" desc:"the network viewer"')
        self.NetViewBidir = 0
        self.SetTags("NetViewBidir", 'view:"-" desc:"the network viewer"')
        self.ToolBar = 0
        self.SetTags("ToolBar", 'view:"-" desc:"the master toolbar"')
        self.TstCycPlot = 0
        self.SetTags("TstCycPlot", '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"')
예제 #13
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"')
예제 #14
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"')
예제 #15
0
    def __init__(self):
        super(Sim, self).__init__()
        self.Spike = True
        self.SetTags(
            "Spike",
            'desc:"use discrete spiking equations -- otherwise use Noisy X-over-X-plus-1 rate code activation function"'
        )
        self.GbarE = float(0.3)
        self.SetTags(
            "GbarE",
            'min:"0" step:"0.01" def:"0.3" desc:"excitatory conductance multiplier -- determines overall value of Ge which drives neuron to be more excited -- pushes up over threshold to fire if strong enough"'
        )
        self.GbarL = float(0.3)
        self.SetTags(
            "GbarL",
            'min:"0" step:"0.01" def:"0.3" desc:"leak conductance -- determines overall value of Gl which drives neuron to be less excited (inhibited) -- pushes back to resting membrane potential"'
        )
        self.ErevE = float(1)
        self.SetTags(
            "ErevE",
            'min:"0" max:"1" step:"0.01" def:"1" desc:"excitatory reversal (driving) potential -- determines where excitation pushes Vm up to"'
        )
        self.ErevL = float(0.3)
        self.SetTags(
            "ErevL",
            'min:"0" max:"1" step:"0.01" def:"0.3" desc:"leak reversal (driving) potential -- determines where excitation pulls Vm down to"'
        )
        self.Noise = float(0.0)
        self.SetTags(
            "Noise",
            'min:"0" step:"0.01" desc:"the variance parameter for Gaussian noise added to unit activations on every cycle"'
        )
        self.KNaAdapt = True
        self.SetTags(
            "KNaAdapt",
            'desc:"apply sodium-gated potassium adaptation mechanisms that cause the neuron to reduce spiking over time"'
        )
        self.NCycles = int(200)
        self.SetTags(
            "NCycles",
            'min:"10" def:"200" desc:"total number of cycles to run"')
        self.OnCycle = int(10)
        self.SetTags(
            "OnCycle",
            'min:"0" def:"10" desc:"when does excitatory input into neuron come on?"'
        )
        self.OffCycle = int(160)
        self.SetTags(
            "OffCycle",
            'min:"0" def:"160" desc:"when does excitatory input into neuron go off?"'
        )
        self.UpdtInterval = int(10)
        self.SetTags(
            "UpdtInterval",
            'min:"1" def:"10"  desc:"how often to update display (in cycles)"')
        self.Net = leabra.Network()
        self.SetTags(
            "Net",
            'view:"no-inline" desc:"the network -- click to view / edit parameters for layers, prjns, etc"'
        )
        self.SpikeParams = spike.ActParams()
        self.SetTags("SpikeParams",
                     'view:"no-inline" desc:"parameters for spiking funcion"')
        self.TstCycLog = etable.Table()
        self.SetTags(
            "TstCycLog",
            'view:"no-inline" desc:"testing trial-level log data -- click to see record of network\'s response to each input"'
        )
        self.SpikeVsRateLog = etable.Table()
        self.SetTags(
            "SpikeVsRateLog",
            'view:"no-inline" desc:"plot of measured spike rate vs. noisy X/X+1 rate function"'
        )
        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.Cycle = int()
        self.SetTags("Cycle", 'inactive:"+" desc:"current cycle of updating"')

        # 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.TstCycPlot = 0
        self.SetTags("TstCycPlot", 'view:"-" desc:"the test-trial plot"')
        self.SpikeVsRatePlot = 0
        self.SetTags("SpikeVsRatePlot",
                     'view:"-" desc:"the spike vs. rate plot"')
        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"')