partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
computeSaturationLevels
Compute the saturation for a continuous level. This breaks the level into multiple regions and computes the saturation level for each region. Parameters: -------------------------------------------- outputs: output of the level. If sparseForm is True, this is a list of the non-zeros. If ...
src/nupic/algorithms/fdrutilities.py
def computeSaturationLevels(outputs, outputsShape, sparseForm=False): """ Compute the saturation for a continuous level. This breaks the level into multiple regions and computes the saturation level for each region. Parameters: -------------------------------------------- outputs: output of the level....
def computeSaturationLevels(outputs, outputsShape, sparseForm=False): """ Compute the saturation for a continuous level. This breaks the level into multiple regions and computes the saturation level for each region. Parameters: -------------------------------------------- outputs: output of the level....
[ "Compute", "the", "saturation", "for", "a", "continuous", "level", ".", "This", "breaks", "the", "level", "into", "multiple", "regions", "and", "computes", "the", "saturation", "level", "for", "each", "region", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1201-L1257
[ "def", "computeSaturationLevels", "(", "outputs", ",", "outputsShape", ",", "sparseForm", "=", "False", ")", ":", "# Get the outputs into a SparseBinaryMatrix", "if", "not", "sparseForm", ":", "outputs", "=", "outputs", ".", "reshape", "(", "outputsShape", ")", "spO...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
checkMatch
Compares the actual input with the predicted input and returns results Parameters: ----------------------------------------------- input: The actual input prediction: the predicted input verbosity: If > 0, print debugging messages sparse: If true, they are in sparse form (list o...
src/nupic/algorithms/fdrutilities.py
def checkMatch(input, prediction, sparse=True, verbosity=0): """ Compares the actual input with the predicted input and returns results Parameters: ----------------------------------------------- input: The actual input prediction: the predicted input verbosity: If > 0, print debuggin...
def checkMatch(input, prediction, sparse=True, verbosity=0): """ Compares the actual input with the predicted input and returns results Parameters: ----------------------------------------------- input: The actual input prediction: the predicted input verbosity: If > 0, print debuggin...
[ "Compares", "the", "actual", "input", "with", "the", "predicted", "input", "and", "returns", "results" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1261-L1307
[ "def", "checkMatch", "(", "input", ",", "prediction", ",", "sparse", "=", "True", ",", "verbosity", "=", "0", ")", ":", "if", "sparse", ":", "activeElementsInInput", "=", "set", "(", "input", ")", "activeElementsInPrediction", "=", "set", "(", "prediction", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
predictionExtent
Computes the predictive ability of a temporal memory (TM). This routine returns a value which is the average number of time steps of prediction provided by the TM. It accepts as input the inputs, outputs, and resets provided to the TM as well as a 'minOverlapPct' used to evalulate whether or not a prediction is...
src/nupic/algorithms/fdrutilities.py
def predictionExtent(inputs, resets, outputs, minOverlapPct=100.0): """ Computes the predictive ability of a temporal memory (TM). This routine returns a value which is the average number of time steps of prediction provided by the TM. It accepts as input the inputs, outputs, and resets provided to the TM as ...
def predictionExtent(inputs, resets, outputs, minOverlapPct=100.0): """ Computes the predictive ability of a temporal memory (TM). This routine returns a value which is the average number of time steps of prediction provided by the TM. It accepts as input the inputs, outputs, and resets provided to the TM as ...
[ "Computes", "the", "predictive", "ability", "of", "a", "temporal", "memory", "(", "TM", ")", ".", "This", "routine", "returns", "a", "value", "which", "is", "the", "average", "number", "of", "time", "steps", "of", "prediction", "provided", "by", "the", "TM...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1311-L1399
[ "def", "predictionExtent", "(", "inputs", ",", "resets", ",", "outputs", ",", "minOverlapPct", "=", "100.0", ")", ":", "# List of how many times we encountered each prediction amount. Element 0", "# is how many times we successfully predicted 0 steps in advance, element 1", "# is h...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
getCentreAndSpreadOffsets
Generates centre offsets and spread offsets for block-mode based training regimes - star, cross, block. Parameters: ----------------------------------------------- spaceShape: The (height, width) of the 2-D space to explore. This sets the number of center-points. spreadShape: The...
src/nupic/algorithms/fdrutilities.py
def getCentreAndSpreadOffsets(spaceShape, spreadShape, stepSize=1): """ Generates centre offsets and spread offsets for block-mode based training regimes - star, cross, block. Parameters: ----------------------------------------------- space...
def getCentreAndSpreadOffsets(spaceShape, spreadShape, stepSize=1): """ Generates centre offsets and spread offsets for block-mode based training regimes - star, cross, block. Parameters: ----------------------------------------------- space...
[ "Generates", "centre", "offsets", "and", "spread", "offsets", "for", "block", "-", "mode", "based", "training", "regimes", "-", "star", "cross", "block", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1403-L1469
[ "def", "getCentreAndSpreadOffsets", "(", "spaceShape", ",", "spreadShape", ",", "stepSize", "=", "1", ")", ":", "from", "nupic", ".", "math", ".", "cross", "import", "cross", "# =====================================================================", "# Init data structures"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
makeCloneMap
Make a two-dimensional clone map mapping columns to clone master. This makes a map that is (numColumnsHigh, numColumnsWide) big that can be used to figure out which clone master to use for each column. Here are a few sample calls >>> makeCloneMap(columnsShape=(10, 6), outputCloningWidth=4) (array([[ 0, 1,...
src/nupic/algorithms/fdrutilities.py
def makeCloneMap(columnsShape, outputCloningWidth, outputCloningHeight=-1): """Make a two-dimensional clone map mapping columns to clone master. This makes a map that is (numColumnsHigh, numColumnsWide) big that can be used to figure out which clone master to use for each column. Here are a few sample calls ...
def makeCloneMap(columnsShape, outputCloningWidth, outputCloningHeight=-1): """Make a two-dimensional clone map mapping columns to clone master. This makes a map that is (numColumnsHigh, numColumnsWide) big that can be used to figure out which clone master to use for each column. Here are a few sample calls ...
[ "Make", "a", "two", "-", "dimensional", "clone", "map", "mapping", "columns", "to", "clone", "master", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1473-L1597
[ "def", "makeCloneMap", "(", "columnsShape", ",", "outputCloningWidth", ",", "outputCloningHeight", "=", "-", "1", ")", ":", "if", "outputCloningHeight", "<", "0", ":", "outputCloningHeight", "=", "outputCloningWidth", "columnsHeight", ",", "columnsWidth", "=", "colu...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
numpyStr
Pretty print a numpy matrix using the given format string for each value. Return the string representation Parameters: ------------------------------------------------------------ array: The numpy array to print. This can be either a 1D vector or 2D matrix format: The format string to use for each value...
src/nupic/algorithms/fdrutilities.py
def numpyStr(array, format='%f', includeIndices=False, includeZeros=True): """ Pretty print a numpy matrix using the given format string for each value. Return the string representation Parameters: ------------------------------------------------------------ array: The numpy array to print. This can be ei...
def numpyStr(array, format='%f', includeIndices=False, includeZeros=True): """ Pretty print a numpy matrix using the given format string for each value. Return the string representation Parameters: ------------------------------------------------------------ array: The numpy array to print. This can be ei...
[ "Pretty", "print", "a", "numpy", "matrix", "using", "the", "given", "format", "string", "for", "each", "value", ".", "Return", "the", "string", "representation" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/algorithms/fdrutilities.py#L1601-L1653
[ "def", "numpyStr", "(", "array", ",", "format", "=", "'%f'", ",", "includeIndices", "=", "False", ",", "includeZeros", "=", "True", ")", ":", "shape", "=", "array", ".", "shape", "assert", "(", "len", "(", "shape", ")", "<=", "2", ")", "items", "=", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DiscreteDistribution.sample
Generates a random sample from the discrete probability distribution and returns its value and the log of the probability of sampling that value.
src/nupic/math/dist.py
def sample(self, rgen): """Generates a random sample from the discrete probability distribution and returns its value and the log of the probability of sampling that value. """ rf = rgen.uniform(0, self.sum) index = bisect.bisect(self.cdf, rf) return self.keys[index], numpy.log(self.pmf[index])
def sample(self, rgen): """Generates a random sample from the discrete probability distribution and returns its value and the log of the probability of sampling that value. """ rf = rgen.uniform(0, self.sum) index = bisect.bisect(self.cdf, rf) return self.keys[index], numpy.log(self.pmf[index])
[ "Generates", "a", "random", "sample", "from", "the", "discrete", "probability", "distribution", "and", "returns", "its", "value", "and", "the", "log", "of", "the", "probability", "of", "sampling", "that", "value", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/math/dist.py#L73-L79
[ "def", "sample", "(", "self", ",", "rgen", ")", ":", "rf", "=", "rgen", ".", "uniform", "(", "0", ",", "self", ".", "sum", ")", "index", "=", "bisect", ".", "bisect", "(", "self", ".", "cdf", ",", "rf", ")", "return", "self", ".", "keys", "[", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
MultinomialDistribution.logProbability
Form of distribution must be an array of counts in order of self.keys.
src/nupic/math/dist.py
def logProbability(self, distn): """Form of distribution must be an array of counts in order of self.keys.""" x = numpy.asarray(distn) n = x.sum() return (logFactorial(n) - numpy.sum([logFactorial(k) for k in x]) + numpy.sum(x * numpy.log(self.dist.pmf)))
def logProbability(self, distn): """Form of distribution must be an array of counts in order of self.keys.""" x = numpy.asarray(distn) n = x.sum() return (logFactorial(n) - numpy.sum([logFactorial(k) for k in x]) + numpy.sum(x * numpy.log(self.dist.pmf)))
[ "Form", "of", "distribution", "must", "be", "an", "array", "of", "counts", "in", "order", "of", "self", ".", "keys", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/math/dist.py#L106-L111
[ "def", "logProbability", "(", "self", ",", "distn", ")", ":", "x", "=", "numpy", ".", "asarray", "(", "distn", ")", "n", "=", "x", ".", "sum", "(", ")", "return", "(", "logFactorial", "(", "n", ")", "-", "numpy", ".", "sum", "(", "[", "logFactori...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
PoissonDistribution.sample
Generates a random sample from the Poisson probability distribution and returns its value and the log of the probability of sampling that value.
src/nupic/math/dist.py
def sample(self, rgen): """Generates a random sample from the Poisson probability distribution and returns its value and the log of the probability of sampling that value. """ x = rgen.poisson(self.lambdaParameter) return x, self.logDensity(x)
def sample(self, rgen): """Generates a random sample from the Poisson probability distribution and returns its value and the log of the probability of sampling that value. """ x = rgen.poisson(self.lambdaParameter) return x, self.logDensity(x)
[ "Generates", "a", "random", "sample", "from", "the", "Poisson", "probability", "distribution", "and", "returns", "its", "value", "and", "the", "log", "of", "the", "probability", "of", "sampling", "that", "value", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/math/dist.py#L132-L137
[ "def", "sample", "(", "self", ",", "rgen", ")", ":", "x", "=", "rgen", ".", "poisson", "(", "self", ".", "lambdaParameter", ")", "return", "x", ",", "self", ".", "logDensity", "(", "x", ")" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
createDataOutLink
Link sensor region to other region so that it can pass it data.
docs/examples/network/complete-network-example.py
def createDataOutLink(network, sensorRegionName, regionName): """Link sensor region to other region so that it can pass it data.""" network.link(sensorRegionName, regionName, "UniformLink", "", srcOutput="dataOut", destInput="bottomUpIn")
def createDataOutLink(network, sensorRegionName, regionName): """Link sensor region to other region so that it can pass it data.""" network.link(sensorRegionName, regionName, "UniformLink", "", srcOutput="dataOut", destInput="bottomUpIn")
[ "Link", "sensor", "region", "to", "other", "region", "so", "that", "it", "can", "pass", "it", "data", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L16-L19
[ "def", "createDataOutLink", "(", "network", ",", "sensorRegionName", ",", "regionName", ")", ":", "network", ".", "link", "(", "sensorRegionName", ",", "regionName", ",", "\"UniformLink\"", ",", "\"\"", ",", "srcOutput", "=", "\"dataOut\"", ",", "destInput", "="...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
createFeedForwardLink
Create a feed-forward link between 2 regions: regionName1 -> regionName2
docs/examples/network/complete-network-example.py
def createFeedForwardLink(network, regionName1, regionName2): """Create a feed-forward link between 2 regions: regionName1 -> regionName2""" network.link(regionName1, regionName2, "UniformLink", "", srcOutput="bottomUpOut", destInput="bottomUpIn")
def createFeedForwardLink(network, regionName1, regionName2): """Create a feed-forward link between 2 regions: regionName1 -> regionName2""" network.link(regionName1, regionName2, "UniformLink", "", srcOutput="bottomUpOut", destInput="bottomUpIn")
[ "Create", "a", "feed", "-", "forward", "link", "between", "2", "regions", ":", "regionName1", "-", ">", "regionName2" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L22-L25
[ "def", "createFeedForwardLink", "(", "network", ",", "regionName1", ",", "regionName2", ")", ":", "network", ".", "link", "(", "regionName1", ",", "regionName2", ",", "\"UniformLink\"", ",", "\"\"", ",", "srcOutput", "=", "\"bottomUpOut\"", ",", "destInput", "="...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
createResetLink
Create a reset link from a sensor region: sensorRegionName -> regionName
docs/examples/network/complete-network-example.py
def createResetLink(network, sensorRegionName, regionName): """Create a reset link from a sensor region: sensorRegionName -> regionName""" network.link(sensorRegionName, regionName, "UniformLink", "", srcOutput="resetOut", destInput="resetIn")
def createResetLink(network, sensorRegionName, regionName): """Create a reset link from a sensor region: sensorRegionName -> regionName""" network.link(sensorRegionName, regionName, "UniformLink", "", srcOutput="resetOut", destInput="resetIn")
[ "Create", "a", "reset", "link", "from", "a", "sensor", "region", ":", "sensorRegionName", "-", ">", "regionName" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L28-L31
[ "def", "createResetLink", "(", "network", ",", "sensorRegionName", ",", "regionName", ")", ":", "network", ".", "link", "(", "sensorRegionName", ",", "regionName", ",", "\"UniformLink\"", ",", "\"\"", ",", "srcOutput", "=", "\"resetOut\"", ",", "destInput", "=",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
createSensorToClassifierLinks
Create required links from a sensor region to a classifier region.
docs/examples/network/complete-network-example.py
def createSensorToClassifierLinks(network, sensorRegionName, classifierRegionName): """Create required links from a sensor region to a classifier region.""" network.link(sensorRegionName, classifierRegionName, "UniformLink", "", srcOutput="bucketIdxOut", destInput="b...
def createSensorToClassifierLinks(network, sensorRegionName, classifierRegionName): """Create required links from a sensor region to a classifier region.""" network.link(sensorRegionName, classifierRegionName, "UniformLink", "", srcOutput="bucketIdxOut", destInput="b...
[ "Create", "required", "links", "from", "a", "sensor", "region", "to", "a", "classifier", "region", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L34-L42
[ "def", "createSensorToClassifierLinks", "(", "network", ",", "sensorRegionName", ",", "classifierRegionName", ")", ":", "network", ".", "link", "(", "sensorRegionName", ",", "classifierRegionName", ",", "\"UniformLink\"", ",", "\"\"", ",", "srcOutput", "=", "\"bucketI...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
createNetwork
Create and initialize a network.
docs/examples/network/complete-network-example.py
def createNetwork(dataSource): """Create and initialize a network.""" with open(_PARAMS_PATH, "r") as f: modelParams = yaml.safe_load(f)["modelParams"] # Create a network that will hold the regions. network = Network() # Add a sensor region. network.addRegion("sensor", "py.RecordSensor", '{}') # Se...
def createNetwork(dataSource): """Create and initialize a network.""" with open(_PARAMS_PATH, "r") as f: modelParams = yaml.safe_load(f)["modelParams"] # Create a network that will hold the regions. network = Network() # Add a sensor region. network.addRegion("sensor", "py.RecordSensor", '{}') # Se...
[ "Create", "and", "initialize", "a", "network", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L52-L91
[ "def", "createNetwork", "(", "dataSource", ")", ":", "with", "open", "(", "_PARAMS_PATH", ",", "\"r\"", ")", "as", "f", ":", "modelParams", "=", "yaml", ".", "safe_load", "(", "f", ")", "[", "\"modelParams\"", "]", "# Create a network that will hold the regions....
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
getPredictionResults
Get prediction results for all prediction steps.
docs/examples/network/complete-network-example.py
def getPredictionResults(network, clRegionName): """Get prediction results for all prediction steps.""" classifierRegion = network.regions[clRegionName] actualValues = classifierRegion.getOutputData("actualValues") probabilities = classifierRegion.getOutputData("probabilities") steps = classifierRegion.getSel...
def getPredictionResults(network, clRegionName): """Get prediction results for all prediction steps.""" classifierRegion = network.regions[clRegionName] actualValues = classifierRegion.getOutputData("actualValues") probabilities = classifierRegion.getOutputData("probabilities") steps = classifierRegion.getSel...
[ "Get", "prediction", "results", "for", "all", "prediction", "steps", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L94-L110
[ "def", "getPredictionResults", "(", "network", ",", "clRegionName", ")", ":", "classifierRegion", "=", "network", ".", "regions", "[", "clRegionName", "]", "actualValues", "=", "classifierRegion", ".", "getOutputData", "(", "\"actualValues\"", ")", "probabilities", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
runHotgym
Run the Hot Gym example.
docs/examples/network/complete-network-example.py
def runHotgym(numRecords): """Run the Hot Gym example.""" # Create a data source for the network. dataSource = FileRecordStream(streamID=_INPUT_FILE_PATH) numRecords = min(numRecords, dataSource.getDataRowCount()) network = createNetwork(dataSource) # Set predicted field network.regions["sensor"].setPar...
def runHotgym(numRecords): """Run the Hot Gym example.""" # Create a data source for the network. dataSource = FileRecordStream(streamID=_INPUT_FILE_PATH) numRecords = min(numRecords, dataSource.getDataRowCount()) network = createNetwork(dataSource) # Set predicted field network.regions["sensor"].setPar...
[ "Run", "the", "Hot", "Gym", "example", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/docs/examples/network/complete-network-example.py#L113-L150
[ "def", "runHotgym", "(", "numRecords", ")", ":", "# Create a data source for the network.", "dataSource", "=", "FileRecordStream", "(", "streamID", "=", "_INPUT_FILE_PATH", ")", "numRecords", "=", "min", "(", "numRecords", ",", "dataSource", ".", "getDataRowCount", "(...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner._loadDummyModelParameters
Loads all the parameters for this dummy model. For any paramters specified as lists, read the appropriate value for this model using the model index
src/nupic/swarming/dummy_model_runner.py
def _loadDummyModelParameters(self, params): """ Loads all the parameters for this dummy model. For any paramters specified as lists, read the appropriate value for this model using the model index """ for key, value in params.iteritems(): if type(value) == list: index = self.modelIndex %...
def _loadDummyModelParameters(self, params): """ Loads all the parameters for this dummy model. For any paramters specified as lists, read the appropriate value for this model using the model index """ for key, value in params.iteritems(): if type(value) == list: index = self.modelIndex %...
[ "Loads", "all", "the", "parameters", "for", "this", "dummy", "model", ".", "For", "any", "paramters", "specified", "as", "lists", "read", "the", "appropriate", "value", "for", "this", "model", "using", "the", "model", "index" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L339-L349
[ "def", "_loadDummyModelParameters", "(", "self", ",", "params", ")", ":", "for", "key", ",", "value", "in", "params", ".", "iteritems", "(", ")", ":", "if", "type", "(", "value", ")", "==", "list", ":", "index", "=", "self", ".", "modelIndex", "%", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner._computModelDelay
Computes the amount of time (if any) to delay the run of this model. This can be determined by two mutually exclusive parameters: delay and sleepModelRange. 'delay' specifies the number of seconds a model should be delayed. If a list is specified, the appropriate amount of delay is determined by using ...
src/nupic/swarming/dummy_model_runner.py
def _computModelDelay(self): """ Computes the amount of time (if any) to delay the run of this model. This can be determined by two mutually exclusive parameters: delay and sleepModelRange. 'delay' specifies the number of seconds a model should be delayed. If a list is specified, the appropriate am...
def _computModelDelay(self): """ Computes the amount of time (if any) to delay the run of this model. This can be determined by two mutually exclusive parameters: delay and sleepModelRange. 'delay' specifies the number of seconds a model should be delayed. If a list is specified, the appropriate am...
[ "Computes", "the", "amount", "of", "time", "(", "if", "any", ")", "to", "delay", "the", "run", "of", "this", "model", ".", "This", "can", "be", "determined", "by", "two", "mutually", "exclusive", "parameters", ":", "delay", "and", "sleepModelRange", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L352-L390
[ "def", "_computModelDelay", "(", "self", ")", ":", "# 'delay' and 'sleepModelRange' are mutually exclusive", "if", "self", ".", "_params", "[", "'delay'", "]", "is", "not", "None", "and", "self", ".", "_params", "[", "'sleepModelRange'", "]", "is", "not", "None", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner._getMetrics
Protected function that can be overridden by subclasses. Its main purpose is to allow the the OPFDummyModelRunner to override this with deterministic values Returns: All the metrics being computed for this model
src/nupic/swarming/dummy_model_runner.py
def _getMetrics(self): """ Protected function that can be overridden by subclasses. Its main purpose is to allow the the OPFDummyModelRunner to override this with deterministic values Returns: All the metrics being computed for this model """ metric = None if self.metrics is not None: ...
def _getMetrics(self): """ Protected function that can be overridden by subclasses. Its main purpose is to allow the the OPFDummyModelRunner to override this with deterministic values Returns: All the metrics being computed for this model """ metric = None if self.metrics is not None: ...
[ "Protected", "function", "that", "can", "be", "overridden", "by", "subclasses", ".", "Its", "main", "purpose", "is", "to", "allow", "the", "the", "OPFDummyModelRunner", "to", "override", "this", "with", "deterministic", "values" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L393-L408
[ "def", "_getMetrics", "(", "self", ")", ":", "metric", "=", "None", "if", "self", ".", "metrics", "is", "not", "None", ":", "metric", "=", "self", ".", "metrics", "(", "self", ".", "_currentRecordIndex", "+", "1", ")", "elif", "self", ".", "metricValue...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner.run
Runs the given OPF task against the given Model instance
src/nupic/swarming/dummy_model_runner.py
def run(self): """ Runs the given OPF task against the given Model instance """ self._logger.debug("Starting Dummy Model: modelID=%s;" % (self._modelID)) # ========================================================================= # Initialize periodic activities (e.g., for model result updates) # ...
def run(self): """ Runs the given OPF task against the given Model instance """ self._logger.debug("Starting Dummy Model: modelID=%s;" % (self._modelID)) # ========================================================================= # Initialize periodic activities (e.g., for model result updates) # ...
[ "Runs", "the", "given", "OPF", "task", "against", "the", "given", "Model", "instance" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L411-L551
[ "def", "run", "(", "self", ")", ":", "self", ".", "_logger", ".", "debug", "(", "\"Starting Dummy Model: modelID=%s;\"", "%", "(", "self", ".", "_modelID", ")", ")", "# =========================================================================", "# Initialize periodic activi...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner._createPredictionLogger
Creates the model's PredictionLogger object, which is an interface to write model results to a permanent storage location
src/nupic/swarming/dummy_model_runner.py
def _createPredictionLogger(self): """ Creates the model's PredictionLogger object, which is an interface to write model results to a permanent storage location """ class DummyLogger: def writeRecord(self, record): pass def writeRecords(self, records, progressCB): pass def close(s...
def _createPredictionLogger(self): """ Creates the model's PredictionLogger object, which is an interface to write model results to a permanent storage location """ class DummyLogger: def writeRecord(self, record): pass def writeRecords(self, records, progressCB): pass def close(s...
[ "Creates", "the", "model", "s", "PredictionLogger", "object", "which", "is", "an", "interface", "to", "write", "model", "results", "to", "a", "permanent", "storage", "location" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L575-L586
[ "def", "_createPredictionLogger", "(", "self", ")", ":", "class", "DummyLogger", ":", "def", "writeRecord", "(", "self", ",", "record", ")", ":", "pass", "def", "writeRecords", "(", "self", ",", "records", ",", "progressCB", ")", ":", "pass", "def", "close...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
OPFDummyModelRunner.__shouldSysExit
Checks to see if the model should exit based on the exitAfter dummy parameter
src/nupic/swarming/dummy_model_runner.py
def __shouldSysExit(self, iteration): """ Checks to see if the model should exit based on the exitAfter dummy parameter """ if self._exitAfter is None \ or iteration < self._exitAfter: return False results = self._jobsDAO.modelsGetFieldsForJob(self._jobID, ['params']) modelID...
def __shouldSysExit(self, iteration): """ Checks to see if the model should exit based on the exitAfter dummy parameter """ if self._exitAfter is None \ or iteration < self._exitAfter: return False results = self._jobsDAO.modelsGetFieldsForJob(self._jobID, ['params']) modelID...
[ "Checks", "to", "see", "if", "the", "model", "should", "exit", "based", "on", "the", "exitAfter", "dummy", "parameter" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/dummy_model_runner.py#L589-L609
[ "def", "__shouldSysExit", "(", "self", ",", "iteration", ")", ":", "if", "self", ".", "_exitAfter", "is", "None", "or", "iteration", "<", "self", ".", "_exitAfter", ":", "return", "False", "results", "=", "self", ".", "_jobsDAO", ".", "modelsGetFieldsForJob"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getDescription
Returns a description of the dataset
src/nupic/data/generators/data_generator.py
def getDescription(self): """Returns a description of the dataset""" description = {'name':self.name, 'fields':[f.name for f in self.fields], \ 'numRecords by field':[f.numRecords for f in self.fields]} return description
def getDescription(self): """Returns a description of the dataset""" description = {'name':self.name, 'fields':[f.name for f in self.fields], \ 'numRecords by field':[f.numRecords for f in self.fields]} return description
[ "Returns", "a", "description", "of", "the", "dataset" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L50-L56
[ "def", "getDescription", "(", "self", ")", ":", "description", "=", "{", "'name'", ":", "self", ".", "name", ",", "'fields'", ":", "[", "f", ".", "name", "for", "f", "in", "self", ".", "fields", "]", ",", "'numRecords by field'", ":", "[", "f", ".", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.setSeed
Set the random seed and the numpy seed Parameters: -------------------------------------------------------------------- seed: random seed
src/nupic/data/generators/data_generator.py
def setSeed(self, seed): """Set the random seed and the numpy seed Parameters: -------------------------------------------------------------------- seed: random seed """ rand.seed(seed) np.random.seed(seed)
def setSeed(self, seed): """Set the random seed and the numpy seed Parameters: -------------------------------------------------------------------- seed: random seed """ rand.seed(seed) np.random.seed(seed)
[ "Set", "the", "random", "seed", "and", "the", "numpy", "seed", "Parameters", ":", "--------------------------------------------------------------------", "seed", ":", "random", "seed" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L59-L67
[ "def", "setSeed", "(", "self", ",", "seed", ")", ":", "rand", ".", "seed", "(", "seed", ")", "np", ".", "random", ".", "seed", "(", "seed", ")" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.addField
Add a single field to the dataset. Parameters: ------------------------------------------------------------------- name: The user-specified name of the field fieldSpec: A list of one or more dictionaries specifying parameters to be used for dataClass initializati...
src/nupic/data/generators/data_generator.py
def addField(self, name, fieldParams, encoderParams): """Add a single field to the dataset. Parameters: ------------------------------------------------------------------- name: The user-specified name of the field fieldSpec: A list of one or more dictionaries specifying parameter...
def addField(self, name, fieldParams, encoderParams): """Add a single field to the dataset. Parameters: ------------------------------------------------------------------- name: The user-specified name of the field fieldSpec: A list of one or more dictionaries specifying parameter...
[ "Add", "a", "single", "field", "to", "the", "dataset", ".", "Parameters", ":", "-------------------------------------------------------------------", "name", ":", "The", "user", "-", "specified", "name", "of", "the", "field", "fieldSpec", ":", "A", "list", "of", "...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L70-L97
[ "def", "addField", "(", "self", ",", "name", ",", "fieldParams", ",", "encoderParams", ")", ":", "assert", "fieldParams", "is", "not", "None", "and", "'type'", "in", "fieldParams", "dataClassName", "=", "fieldParams", ".", "pop", "(", "'type'", ")", "try", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.addMultipleFields
Add multiple fields to the dataset. Parameters: ------------------------------------------------------------------- fieldsInfo: A list of dictionaries, containing a field name, specs for the data classes and encoder params for the corresponding field.
src/nupic/data/generators/data_generator.py
def addMultipleFields(self, fieldsInfo): """Add multiple fields to the dataset. Parameters: ------------------------------------------------------------------- fieldsInfo: A list of dictionaries, containing a field name, specs for the data classes and encoder params for the c...
def addMultipleFields(self, fieldsInfo): """Add multiple fields to the dataset. Parameters: ------------------------------------------------------------------- fieldsInfo: A list of dictionaries, containing a field name, specs for the data classes and encoder params for the c...
[ "Add", "multiple", "fields", "to", "the", "dataset", ".", "Parameters", ":", "-------------------------------------------------------------------", "fieldsInfo", ":", "A", "list", "of", "dictionaries", "containing", "a", "field", "name", "specs", "for", "the", "data", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L100-L112
[ "def", "addMultipleFields", "(", "self", ",", "fieldsInfo", ")", ":", "assert", "all", "(", "x", "in", "field", "for", "x", "in", "[", "'name'", ",", "'fieldSpec'", ",", "'encoderParams'", "]", "for", "field", "in", "fieldsInfo", ")", "for", "spec", "in"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.defineField
Initialize field using relevant encoder parameters. Parameters: ------------------------------------------------------------------- name: Field name encoderParams: Parameters for the encoder. Returns the index of the field
src/nupic/data/generators/data_generator.py
def defineField(self, name, encoderParams=None): """Initialize field using relevant encoder parameters. Parameters: ------------------------------------------------------------------- name: Field name encoderParams: Parameters for the encoder. Returns the index of the fie...
def defineField(self, name, encoderParams=None): """Initialize field using relevant encoder parameters. Parameters: ------------------------------------------------------------------- name: Field name encoderParams: Parameters for the encoder. Returns the index of the fie...
[ "Initialize", "field", "using", "relevant", "encoder", "parameters", ".", "Parameters", ":", "-------------------------------------------------------------------", "name", ":", "Field", "name", "encoderParams", ":", "Parameters", "for", "the", "encoder", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L115-L126
[ "def", "defineField", "(", "self", ",", "name", ",", "encoderParams", "=", "None", ")", ":", "self", ".", "fields", ".", "append", "(", "_field", "(", "name", ",", "encoderParams", ")", ")", "return", "len", "(", "self", ".", "fields", ")", "-", "1" ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.setFlag
Set flag for field at index. Flags are special characters such as 'S' for sequence or 'T' for timestamp. Parameters: -------------------------------------------------------------------- index: index of field whose flag is being set flag: special character
src/nupic/data/generators/data_generator.py
def setFlag(self, index, flag): """Set flag for field at index. Flags are special characters such as 'S' for sequence or 'T' for timestamp. Parameters: -------------------------------------------------------------------- index: index of field whose flag is being set flag: ...
def setFlag(self, index, flag): """Set flag for field at index. Flags are special characters such as 'S' for sequence or 'T' for timestamp. Parameters: -------------------------------------------------------------------- index: index of field whose flag is being set flag: ...
[ "Set", "flag", "for", "field", "at", "index", ".", "Flags", "are", "special", "characters", "such", "as", "S", "for", "sequence", "or", "T", "for", "timestamp", ".", "Parameters", ":", "--------------------------------------------------------------------", "index", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L129-L138
[ "def", "setFlag", "(", "self", ",", "index", ",", "flag", ")", ":", "assert", "len", "(", "self", ".", "fields", ")", ">", "index", "self", ".", "fields", "[", "index", "]", ".", "flag", "=", "flag" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.generateRecord
Generate a record. Each value is stored in its respective field. Parameters: -------------------------------------------------------------------- record: A 1-D array containing as many values as the number of fields fields: An object of the class field that specifies the characteristics ...
src/nupic/data/generators/data_generator.py
def generateRecord(self, record): """Generate a record. Each value is stored in its respective field. Parameters: -------------------------------------------------------------------- record: A 1-D array containing as many values as the number of fields fields: An object of the class fiel...
def generateRecord(self, record): """Generate a record. Each value is stored in its respective field. Parameters: -------------------------------------------------------------------- record: A 1-D array containing as many values as the number of fields fields: An object of the class fiel...
[ "Generate", "a", "record", ".", "Each", "value", "is", "stored", "in", "its", "respective", "field", ".", "Parameters", ":", "--------------------------------------------------------------------", "record", ":", "A", "1", "-", "D", "array", "containing", "as", "many...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L141-L163
[ "def", "generateRecord", "(", "self", ",", "record", ")", ":", "assert", "(", "len", "(", "record", ")", "==", "len", "(", "self", ".", "fields", ")", ")", "if", "record", "is", "not", "None", ":", "for", "x", "in", "range", "(", "len", "(", "sel...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.generateRecords
Generate multiple records. Refer to definition for generateRecord
src/nupic/data/generators/data_generator.py
def generateRecords(self, records): """Generate multiple records. Refer to definition for generateRecord""" if self.verbosity>0: print 'Generating', len(records), 'records...' for record in records: self.generateRecord(record)
def generateRecords(self, records): """Generate multiple records. Refer to definition for generateRecord""" if self.verbosity>0: print 'Generating', len(records), 'records...' for record in records: self.generateRecord(record)
[ "Generate", "multiple", "records", ".", "Refer", "to", "definition", "for", "generateRecord" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L166-L171
[ "def", "generateRecords", "(", "self", ",", "records", ")", ":", "if", "self", ".", "verbosity", ">", "0", ":", "print", "'Generating'", ",", "len", "(", "records", ")", ",", "'records...'", "for", "record", "in", "records", ":", "self", ".", "generateRe...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getRecord
Returns the nth record
src/nupic/data/generators/data_generator.py
def getRecord(self, n=None): """Returns the nth record""" if n is None: assert len(self.fields)>0 n = self.fields[0].numRecords-1 assert (all(field.numRecords>n for field in self.fields)) record = [field.values[n] for field in self.fields] return record
def getRecord(self, n=None): """Returns the nth record""" if n is None: assert len(self.fields)>0 n = self.fields[0].numRecords-1 assert (all(field.numRecords>n for field in self.fields)) record = [field.values[n] for field in self.fields] return record
[ "Returns", "the", "nth", "record" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L174-L185
[ "def", "getRecord", "(", "self", ",", "n", "=", "None", ")", ":", "if", "n", "is", "None", ":", "assert", "len", "(", "self", ".", "fields", ")", ">", "0", "n", "=", "self", ".", "fields", "[", "0", "]", ".", "numRecords", "-", "1", "assert", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getAllRecords
Returns all the records
src/nupic/data/generators/data_generator.py
def getAllRecords(self): """Returns all the records""" values=[] numRecords = self.fields[0].numRecords assert (all(field.numRecords==numRecords for field in self.fields)) for x in range(numRecords): values.append(self.getRecord(x)) return values
def getAllRecords(self): """Returns all the records""" values=[] numRecords = self.fields[0].numRecords assert (all(field.numRecords==numRecords for field in self.fields)) for x in range(numRecords): values.append(self.getRecord(x)) return values
[ "Returns", "all", "the", "records" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L188-L197
[ "def", "getAllRecords", "(", "self", ")", ":", "values", "=", "[", "]", "numRecords", "=", "self", ".", "fields", "[", "0", "]", ".", "numRecords", "assert", "(", "all", "(", "field", ".", "numRecords", "==", "numRecords", "for", "field", "in", "self",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.encodeRecord
Encode a record as a sparse distributed representation Parameters: -------------------------------------------------------------------- record: Record to be encoded toBeAdded: Whether the encodings corresponding to the record are added to the corresponding fields
src/nupic/data/generators/data_generator.py
def encodeRecord(self, record, toBeAdded=True): """Encode a record as a sparse distributed representation Parameters: -------------------------------------------------------------------- record: Record to be encoded toBeAdded: Whether the encodings corresponding to the record are added to...
def encodeRecord(self, record, toBeAdded=True): """Encode a record as a sparse distributed representation Parameters: -------------------------------------------------------------------- record: Record to be encoded toBeAdded: Whether the encodings corresponding to the record are added to...
[ "Encode", "a", "record", "as", "a", "sparse", "distributed", "representation", "Parameters", ":", "--------------------------------------------------------------------", "record", ":", "Record", "to", "be", "encoded", "toBeAdded", ":", "Whether", "the", "encodings", "corr...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L200-L211
[ "def", "encodeRecord", "(", "self", ",", "record", ",", "toBeAdded", "=", "True", ")", ":", "encoding", "=", "[", "self", ".", "fields", "[", "i", "]", ".", "encodeValue", "(", "record", "[", "i", "]", ",", "toBeAdded", ")", "for", "i", "in", "xran...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.encodeAllRecords
Encodes a list of records. Parameters: -------------------------------------------------------------------- records: One or more records. (i,j)th element of this 2D array specifies the value at field j of record i. If unspecified, records previously generated and sto...
src/nupic/data/generators/data_generator.py
def encodeAllRecords(self, records=None, toBeAdded=True): """Encodes a list of records. Parameters: -------------------------------------------------------------------- records: One or more records. (i,j)th element of this 2D array specifies the value at field j of record i. ...
def encodeAllRecords(self, records=None, toBeAdded=True): """Encodes a list of records. Parameters: -------------------------------------------------------------------- records: One or more records. (i,j)th element of this 2D array specifies the value at field j of record i. ...
[ "Encodes", "a", "list", "of", "records", ".", "Parameters", ":", "--------------------------------------------------------------------", "records", ":", "One", "or", "more", "records", ".", "(", "i", "j", ")", "th", "element", "of", "this", "2D", "array", "specifi...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L214-L230
[ "def", "encodeAllRecords", "(", "self", ",", "records", "=", "None", ",", "toBeAdded", "=", "True", ")", ":", "if", "records", "is", "None", ":", "records", "=", "self", ".", "getAllRecords", "(", ")", "if", "self", ".", "verbosity", ">", "0", ":", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.addValueToField
Add 'value' to the field i. Parameters: -------------------------------------------------------------------- value: value to be added i: value is added to field i
src/nupic/data/generators/data_generator.py
def addValueToField(self, i, value=None): """Add 'value' to the field i. Parameters: -------------------------------------------------------------------- value: value to be added i: value is added to field i """ assert(len(self.fields)>i) if value is None: value = ...
def addValueToField(self, i, value=None): """Add 'value' to the field i. Parameters: -------------------------------------------------------------------- value: value to be added i: value is added to field i """ assert(len(self.fields)>i) if value is None: value = ...
[ "Add", "value", "to", "the", "field", "i", ".", "Parameters", ":", "--------------------------------------------------------------------", "value", ":", "value", "to", "be", "added", "i", ":", "value", "is", "added", "to", "field", "i" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L233-L247
[ "def", "addValueToField", "(", "self", ",", "i", ",", "value", "=", "None", ")", ":", "assert", "(", "len", "(", "self", ".", "fields", ")", ">", "i", ")", "if", "value", "is", "None", ":", "value", "=", "self", ".", "fields", "[", "i", "]", "....
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.addValuesToField
Add values to the field i.
src/nupic/data/generators/data_generator.py
def addValuesToField(self, i, numValues): """Add values to the field i.""" assert(len(self.fields)>i) values = [self.addValueToField(i) for n in range(numValues)] return values
def addValuesToField(self, i, numValues): """Add values to the field i.""" assert(len(self.fields)>i) values = [self.addValueToField(i) for n in range(numValues)] return values
[ "Add", "values", "to", "the", "field", "i", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L250-L255
[ "def", "addValuesToField", "(", "self", ",", "i", ",", "numValues", ")", ":", "assert", "(", "len", "(", "self", ".", "fields", ")", ">", "i", ")", "values", "=", "[", "self", ".", "addValueToField", "(", "i", ")", "for", "n", "in", "range", "(", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getSDRforValue
Returns the sdr for jth value at column i
src/nupic/data/generators/data_generator.py
def getSDRforValue(self, i, j): """Returns the sdr for jth value at column i""" assert len(self.fields)>i assert self.fields[i].numRecords>j encoding = self.fields[i].encodings[j] return encoding
def getSDRforValue(self, i, j): """Returns the sdr for jth value at column i""" assert len(self.fields)>i assert self.fields[i].numRecords>j encoding = self.fields[i].encodings[j] return encoding
[ "Returns", "the", "sdr", "for", "jth", "value", "at", "column", "i" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L258-L264
[ "def", "getSDRforValue", "(", "self", ",", "i", ",", "j", ")", ":", "assert", "len", "(", "self", ".", "fields", ")", ">", "i", "assert", "self", ".", "fields", "[", "i", "]", ".", "numRecords", ">", "j", "encoding", "=", "self", ".", "fields", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getZeroedOutEncoding
Returns the nth encoding with the predictedField zeroed out
src/nupic/data/generators/data_generator.py
def getZeroedOutEncoding(self, n): """Returns the nth encoding with the predictedField zeroed out""" assert all(field.numRecords>n for field in self.fields) encoding = np.concatenate([field.encoder.encode(SENTINEL_VALUE_FOR_MISSING_DATA)\ if field.isPredictedField else field.encodings[n] for field...
def getZeroedOutEncoding(self, n): """Returns the nth encoding with the predictedField zeroed out""" assert all(field.numRecords>n for field in self.fields) encoding = np.concatenate([field.encoder.encode(SENTINEL_VALUE_FOR_MISSING_DATA)\ if field.isPredictedField else field.encodings[n] for field...
[ "Returns", "the", "nth", "encoding", "with", "the", "predictedField", "zeroed", "out" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L267-L275
[ "def", "getZeroedOutEncoding", "(", "self", ",", "n", ")", ":", "assert", "all", "(", "field", ".", "numRecords", ">", "n", "for", "field", "in", "self", ".", "fields", ")", "encoding", "=", "np", ".", "concatenate", "(", "[", "field", ".", "encoder", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getTotaln
Returns the cumulative n for all the fields in the dataset
src/nupic/data/generators/data_generator.py
def getTotaln(self): """Returns the cumulative n for all the fields in the dataset""" n = sum([field.n for field in self.fields]) return n
def getTotaln(self): """Returns the cumulative n for all the fields in the dataset""" n = sum([field.n for field in self.fields]) return n
[ "Returns", "the", "cumulative", "n", "for", "all", "the", "fields", "in", "the", "dataset" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L278-L282
[ "def", "getTotaln", "(", "self", ")", ":", "n", "=", "sum", "(", "[", "field", ".", "n", "for", "field", "in", "self", ".", "fields", "]", ")", "return", "n" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getTotalw
Returns the cumulative w for all the fields in the dataset
src/nupic/data/generators/data_generator.py
def getTotalw(self): """Returns the cumulative w for all the fields in the dataset""" w = sum([field.w for field in self.fields]) return w
def getTotalw(self): """Returns the cumulative w for all the fields in the dataset""" w = sum([field.w for field in self.fields]) return w
[ "Returns", "the", "cumulative", "w", "for", "all", "the", "fields", "in", "the", "dataset" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L285-L289
[ "def", "getTotalw", "(", "self", ")", ":", "w", "=", "sum", "(", "[", "field", ".", "w", "for", "field", "in", "self", ".", "fields", "]", ")", "return", "w" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getEncoding
Returns the nth encoding
src/nupic/data/generators/data_generator.py
def getEncoding(self, n): """Returns the nth encoding""" assert (all(field.numEncodings>n for field in self.fields)) encoding = np.concatenate([field.encodings[n] for field in self.fields]) return encoding
def getEncoding(self, n): """Returns the nth encoding""" assert (all(field.numEncodings>n for field in self.fields)) encoding = np.concatenate([field.encodings[n] for field in self.fields]) return encoding
[ "Returns", "the", "nth", "encoding" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L292-L298
[ "def", "getEncoding", "(", "self", ",", "n", ")", ":", "assert", "(", "all", "(", "field", ".", "numEncodings", ">", "n", "for", "field", "in", "self", ".", "fields", ")", ")", "encoding", "=", "np", ".", "concatenate", "(", "[", "field", ".", "enc...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.getAllEncodings
Returns encodings for all the records
src/nupic/data/generators/data_generator.py
def getAllEncodings(self): """Returns encodings for all the records""" numEncodings=self.fields[0].numEncodings assert (all(field.numEncodings==numEncodings for field in self.fields)) encodings = [self.getEncoding(index) for index in range(numEncodings)] return encodings
def getAllEncodings(self): """Returns encodings for all the records""" numEncodings=self.fields[0].numEncodings assert (all(field.numEncodings==numEncodings for field in self.fields)) encodings = [self.getEncoding(index) for index in range(numEncodings)] return encodings
[ "Returns", "encodings", "for", "all", "the", "records" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L301-L308
[ "def", "getAllEncodings", "(", "self", ")", ":", "numEncodings", "=", "self", ".", "fields", "[", "0", "]", ".", "numEncodings", "assert", "(", "all", "(", "field", ".", "numEncodings", "==", "numEncodings", "for", "field", "in", "self", ".", "fields", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.saveRecords
Export all the records into a csv file in numenta format. Example header format: fieldName1 fieldName2 fieldName3 date string float T S Parameters: -------------------------------------------------------------------- path: Relative path of the file to...
src/nupic/data/generators/data_generator.py
def saveRecords(self, path='myOutput'): """Export all the records into a csv file in numenta format. Example header format: fieldName1 fieldName2 fieldName3 date string float T S Parameters: -----------------------------------------------------------------...
def saveRecords(self, path='myOutput'): """Export all the records into a csv file in numenta format. Example header format: fieldName1 fieldName2 fieldName3 date string float T S Parameters: -----------------------------------------------------------------...
[ "Export", "all", "the", "records", "into", "a", "csv", "file", "in", "numenta", "format", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L339-L363
[ "def", "saveRecords", "(", "self", ",", "path", "=", "'myOutput'", ")", ":", "numRecords", "=", "self", ".", "fields", "[", "0", "]", ".", "numRecords", "assert", "(", "all", "(", "field", ".", "numRecords", "==", "numRecords", "for", "field", "in", "s...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
DataGenerator.removeAllRecords
Deletes all the values in the dataset
src/nupic/data/generators/data_generator.py
def removeAllRecords(self): """Deletes all the values in the dataset""" for field in self.fields: field.encodings, field.values=[], [] field.numRecords, field.numEncodings= (0, 0)
def removeAllRecords(self): """Deletes all the values in the dataset""" for field in self.fields: field.encodings, field.values=[], [] field.numRecords, field.numEncodings= (0, 0)
[ "Deletes", "all", "the", "values", "in", "the", "dataset" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L366-L371
[ "def", "removeAllRecords", "(", "self", ")", ":", "for", "field", "in", "self", ".", "fields", ":", "field", ".", "encodings", ",", "field", ".", "values", "=", "[", "]", ",", "[", "]", "field", ".", "numRecords", ",", "field", ".", "numEncodings", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_field.encodeValue
Value is encoded as a sdr using the encoding parameters of the Field
src/nupic/data/generators/data_generator.py
def encodeValue(self, value, toBeAdded=True): """Value is encoded as a sdr using the encoding parameters of the Field""" encodedValue = np.array(self.encoder.encode(value), dtype=realDType) if toBeAdded: self.encodings.append(encodedValue) self.numEncodings+=1 return encodedValue
def encodeValue(self, value, toBeAdded=True): """Value is encoded as a sdr using the encoding parameters of the Field""" encodedValue = np.array(self.encoder.encode(value), dtype=realDType) if toBeAdded: self.encodings.append(encodedValue) self.numEncodings+=1 return encodedValue
[ "Value", "is", "encoded", "as", "a", "sdr", "using", "the", "encoding", "parameters", "of", "the", "Field" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L444-L453
[ "def", "encodeValue", "(", "self", ",", "value", ",", "toBeAdded", "=", "True", ")", ":", "encodedValue", "=", "np", ".", "array", "(", "self", ".", "encoder", ".", "encode", "(", "value", ")", ",", "dtype", "=", "realDType", ")", "if", "toBeAdded", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_field._setTypes
Set up the dataTypes and initialize encoders
src/nupic/data/generators/data_generator.py
def _setTypes(self, encoderSpec): """Set up the dataTypes and initialize encoders""" if self.encoderType is None: if self.dataType in ['int','float']: self.encoderType='adaptiveScalar' elif self.dataType=='string': self.encoderType='category' elif self.dataType in ['date', 'da...
def _setTypes(self, encoderSpec): """Set up the dataTypes and initialize encoders""" if self.encoderType is None: if self.dataType in ['int','float']: self.encoderType='adaptiveScalar' elif self.dataType=='string': self.encoderType='category' elif self.dataType in ['date', 'da...
[ "Set", "up", "the", "dataTypes", "and", "initialize", "encoders" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L456-L473
[ "def", "_setTypes", "(", "self", ",", "encoderSpec", ")", ":", "if", "self", ".", "encoderType", "is", "None", ":", "if", "self", ".", "dataType", "in", "[", "'int'", ",", "'float'", "]", ":", "self", ".", "encoderType", "=", "'adaptiveScalar'", "elif", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_field._initializeEncoders
Initialize the encoders
src/nupic/data/generators/data_generator.py
def _initializeEncoders(self, encoderSpec): """ Initialize the encoders""" #Initializing scalar encoder if self.encoderType in ['adaptiveScalar', 'scalar']: if 'minval' in encoderSpec: self.minval = encoderSpec.pop('minval') else: self.minval=None if 'maxval' in encoderSpec: ...
def _initializeEncoders(self, encoderSpec): """ Initialize the encoders""" #Initializing scalar encoder if self.encoderType in ['adaptiveScalar', 'scalar']: if 'minval' in encoderSpec: self.minval = encoderSpec.pop('minval') else: self.minval=None if 'maxval' in encoderSpec: ...
[ "Initialize", "the", "encoders" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/data/generators/data_generator.py#L476-L500
[ "def", "_initializeEncoders", "(", "self", ",", "encoderSpec", ")", ":", "#Initializing scalar encoder", "if", "self", ".", "encoderType", "in", "[", "'adaptiveScalar'", ",", "'scalar'", "]", ":", "if", "'minval'", "in", "encoderSpec", ":", "self", ".", "minval"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.getScalars
See method description in base.py
src/nupic/encoders/category.py
def getScalars(self, input): """ See method description in base.py """ if input == SENTINEL_VALUE_FOR_MISSING_DATA: return numpy.array([None]) else: return numpy.array([self.categoryToIndex.get(input, 0)])
def getScalars(self, input): """ See method description in base.py """ if input == SENTINEL_VALUE_FOR_MISSING_DATA: return numpy.array([None]) else: return numpy.array([self.categoryToIndex.get(input, 0)])
[ "See", "method", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L105-L110
[ "def", "getScalars", "(", "self", ",", "input", ")", ":", "if", "input", "==", "SENTINEL_VALUE_FOR_MISSING_DATA", ":", "return", "numpy", ".", "array", "(", "[", "None", "]", ")", "else", ":", "return", "numpy", ".", "array", "(", "[", "self", ".", "ca...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.getBucketIndices
See method description in base.py
src/nupic/encoders/category.py
def getBucketIndices(self, input): """ See method description in base.py """ # Get the bucket index from the underlying scalar encoder if input == SENTINEL_VALUE_FOR_MISSING_DATA: return [None] else: return self.encoder.getBucketIndices(self.categoryToIndex.get(input, 0))
def getBucketIndices(self, input): """ See method description in base.py """ # Get the bucket index from the underlying scalar encoder if input == SENTINEL_VALUE_FOR_MISSING_DATA: return [None] else: return self.encoder.getBucketIndices(self.categoryToIndex.get(input, 0))
[ "See", "method", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L113-L120
[ "def", "getBucketIndices", "(", "self", ",", "input", ")", ":", "# Get the bucket index from the underlying scalar encoder", "if", "input", "==", "SENTINEL_VALUE_FOR_MISSING_DATA", ":", "return", "[", "None", "]", "else", ":", "return", "self", ".", "encoder", ".", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.decode
See the function description in base.py
src/nupic/encoders/category.py
def decode(self, encoded, parentFieldName=''): """ See the function description in base.py """ # Get the scalar values from the underlying scalar encoder (fieldsDict, fieldNames) = self.encoder.decode(encoded) if len(fieldsDict) == 0: return (fieldsDict, fieldNames) # Expect only 1 field...
def decode(self, encoded, parentFieldName=''): """ See the function description in base.py """ # Get the scalar values from the underlying scalar encoder (fieldsDict, fieldNames) = self.encoder.decode(encoded) if len(fieldsDict) == 0: return (fieldsDict, fieldNames) # Expect only 1 field...
[ "See", "the", "function", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L137-L169
[ "def", "decode", "(", "self", ",", "encoded", ",", "parentFieldName", "=", "''", ")", ":", "# Get the scalar values from the underlying scalar encoder", "(", "fieldsDict", ",", "fieldNames", ")", "=", "self", ".", "encoder", ".", "decode", "(", "encoded", ")", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.closenessScores
See the function description in base.py kwargs will have the keyword "fractional", which is ignored by this encoder
src/nupic/encoders/category.py
def closenessScores(self, expValues, actValues, fractional=True,): """ See the function description in base.py kwargs will have the keyword "fractional", which is ignored by this encoder """ expValue = expValues[0] actValue = actValues[0] if expValue == actValue: closeness = 1.0 els...
def closenessScores(self, expValues, actValues, fractional=True,): """ See the function description in base.py kwargs will have the keyword "fractional", which is ignored by this encoder """ expValue = expValues[0] actValue = actValues[0] if expValue == actValue: closeness = 1.0 els...
[ "See", "the", "function", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L172-L189
[ "def", "closenessScores", "(", "self", ",", "expValues", ",", "actValues", ",", "fractional", "=", "True", ",", ")", ":", "expValue", "=", "expValues", "[", "0", "]", "actValue", "=", "actValues", "[", "0", "]", "if", "expValue", "==", "actValue", ":", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.getBucketValues
See the function description in base.py
src/nupic/encoders/category.py
def getBucketValues(self): """ See the function description in base.py """ if self._bucketValues is None: numBuckets = len(self.encoder.getBucketValues()) self._bucketValues = [] for bucketIndex in range(numBuckets): self._bucketValues.append(self.getBucketInfo([bucketIndex])[0].value...
def getBucketValues(self): """ See the function description in base.py """ if self._bucketValues is None: numBuckets = len(self.encoder.getBucketValues()) self._bucketValues = [] for bucketIndex in range(numBuckets): self._bucketValues.append(self.getBucketInfo([bucketIndex])[0].value...
[ "See", "the", "function", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L192-L201
[ "def", "getBucketValues", "(", "self", ")", ":", "if", "self", ".", "_bucketValues", "is", "None", ":", "numBuckets", "=", "len", "(", "self", ".", "encoder", ".", "getBucketValues", "(", ")", ")", "self", ".", "_bucketValues", "=", "[", "]", "for", "b...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.getBucketInfo
See the function description in base.py
src/nupic/encoders/category.py
def getBucketInfo(self, buckets): """ See the function description in base.py """ # For the category encoder, the bucket index is the category index bucketInfo = self.encoder.getBucketInfo(buckets)[0] categoryIndex = int(round(bucketInfo.value)) category = self.indexToCategory[categoryIndex] ...
def getBucketInfo(self, buckets): """ See the function description in base.py """ # For the category encoder, the bucket index is the category index bucketInfo = self.encoder.getBucketInfo(buckets)[0] categoryIndex = int(round(bucketInfo.value)) category = self.indexToCategory[categoryIndex] ...
[ "See", "the", "function", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L204-L215
[ "def", "getBucketInfo", "(", "self", ",", "buckets", ")", ":", "# For the category encoder, the bucket index is the category index", "bucketInfo", "=", "self", ".", "encoder", ".", "getBucketInfo", "(", "buckets", ")", "[", "0", "]", "categoryIndex", "=", "int", "("...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
CategoryEncoder.topDownCompute
See the function description in base.py
src/nupic/encoders/category.py
def topDownCompute(self, encoded): """ See the function description in base.py """ encoderResult = self.encoder.topDownCompute(encoded)[0] value = encoderResult.value categoryIndex = int(round(value)) category = self.indexToCategory[categoryIndex] return EncoderResult(value=category, scala...
def topDownCompute(self, encoded): """ See the function description in base.py """ encoderResult = self.encoder.topDownCompute(encoded)[0] value = encoderResult.value categoryIndex = int(round(value)) category = self.indexToCategory[categoryIndex] return EncoderResult(value=category, scala...
[ "See", "the", "function", "description", "in", "base", ".", "py" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/encoders/category.py#L218-L228
[ "def", "topDownCompute", "(", "self", ",", "encoded", ")", ":", "encoderResult", "=", "self", ".", "encoder", ".", "topDownCompute", "(", "encoded", ")", "[", "0", "]", "value", "=", "encoderResult", ".", "value", "categoryIndex", "=", "int", "(", "round",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
loadExperiment
Loads the experiment description file from the path. :param path: (string) The path to a directory containing a description.py file or the file itself. :returns: (config, control)
src/nupic/frameworks/opf/helpers.py
def loadExperiment(path): """Loads the experiment description file from the path. :param path: (string) The path to a directory containing a description.py file or the file itself. :returns: (config, control) """ if not os.path.isdir(path): path = os.path.dirname(path) descriptionPyModule = lo...
def loadExperiment(path): """Loads the experiment description file from the path. :param path: (string) The path to a directory containing a description.py file or the file itself. :returns: (config, control) """ if not os.path.isdir(path): path = os.path.dirname(path) descriptionPyModule = lo...
[ "Loads", "the", "experiment", "description", "file", "from", "the", "path", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/frameworks/opf/helpers.py#L37-L48
[ "def", "loadExperiment", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "path", "=", "os", ".", "path", ".", "dirname", "(", "path", ")", "descriptionPyModule", "=", "loadExperimentDescriptionScriptFromDir", "("...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
loadExperimentDescriptionScriptFromDir
Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts
src/nupic/frameworks/opf/helpers.py
def loadExperimentDescriptionScriptFromDir(experimentDir): """ Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts """ descriptionScriptPath = os.pa...
def loadExperimentDescriptionScriptFromDir(experimentDir): """ Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts """ descriptionScriptPath = os.pa...
[ "Loads", "the", "experiment", "description", "python", "script", "from", "the", "given", "experiment", "directory", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/frameworks/opf/helpers.py#L51-L61
[ "def", "loadExperimentDescriptionScriptFromDir", "(", "experimentDir", ")", ":", "descriptionScriptPath", "=", "os", ".", "path", ".", "join", "(", "experimentDir", ",", "\"description.py\"", ")", "module", "=", "_loadDescriptionFile", "(", "descriptionScriptPath", ")",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
getExperimentDescriptionInterfaceFromModule
:param module: imported description.py module :returns: (:class:`nupic.frameworks.opf.exp_description_api.DescriptionIface`) represents the experiment description
src/nupic/frameworks/opf/helpers.py
def getExperimentDescriptionInterfaceFromModule(module): """ :param module: imported description.py module :returns: (:class:`nupic.frameworks.opf.exp_description_api.DescriptionIface`) represents the experiment description """ result = module.descriptionInterface assert isinstance(result, exp_...
def getExperimentDescriptionInterfaceFromModule(module): """ :param module: imported description.py module :returns: (:class:`nupic.frameworks.opf.exp_description_api.DescriptionIface`) represents the experiment description """ result = module.descriptionInterface assert isinstance(result, exp_...
[ ":", "param", "module", ":", "imported", "description", ".", "py", "module" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/frameworks/opf/helpers.py#L64-L75
[ "def", "getExperimentDescriptionInterfaceFromModule", "(", "module", ")", ":", "result", "=", "module", ".", "descriptionInterface", "assert", "isinstance", "(", "result", ",", "exp_description_api", ".", "DescriptionIface", ")", ",", "\"expected DescriptionIface-based inst...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_loadDescriptionFile
Loads a description file and returns it as a module. descriptionPyPath: path of description.py file to load
src/nupic/frameworks/opf/helpers.py
def _loadDescriptionFile(descriptionPyPath): """Loads a description file and returns it as a module. descriptionPyPath: path of description.py file to load """ global g_descriptionImportCount if not os.path.isfile(descriptionPyPath): raise RuntimeError(("Experiment description file %s does not exist or ...
def _loadDescriptionFile(descriptionPyPath): """Loads a description file and returns it as a module. descriptionPyPath: path of description.py file to load """ global g_descriptionImportCount if not os.path.isfile(descriptionPyPath): raise RuntimeError(("Experiment description file %s does not exist or ...
[ "Loads", "a", "description", "file", "and", "returns", "it", "as", "a", "module", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/frameworks/opf/helpers.py#L80-L104
[ "def", "_loadDescriptionFile", "(", "descriptionPyPath", ")", ":", "global", "g_descriptionImportCount", "if", "not", "os", ".", "path", ".", "isfile", "(", "descriptionPyPath", ")", ":", "raise", "RuntimeError", "(", "(", "\"Experiment description file %s does not exis...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.update
Insert a new entry or update an existing one. If this is an update of an existing entry, then modelParams will be None Parameters: -------------------------------------------------------------------- modelID: globally unique modelID of this model modelParams: params dict for this model, or...
src/nupic/swarming/hypersearch_v2.py
def update(self, modelID, modelParams, modelParamsHash, metricResult, completed, completionReason, matured, numRecords): """ Insert a new entry or update an existing one. If this is an update of an existing entry, then modelParams will be None Parameters: ----------------------------------...
def update(self, modelID, modelParams, modelParamsHash, metricResult, completed, completionReason, matured, numRecords): """ Insert a new entry or update an existing one. If this is an update of an existing entry, then modelParams will be None Parameters: ----------------------------------...
[ "Insert", "a", "new", "entry", "or", "update", "an", "existing", "one", ".", "If", "this", "is", "an", "update", "of", "an", "existing", "entry", "then", "modelParams", "will", "be", "None" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L134-L308
[ "def", "update", "(", "self", ",", "modelID", ",", "modelParams", ",", "modelParamsHash", ",", "metricResult", ",", "completed", ",", "completionReason", ",", "matured", ",", "numRecords", ")", ":", "# The modelParamsHash must always be provided - it can change after a", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getModelIDFromParamsHash
Return the modelID of the model with the given paramsHash, or None if not found. Parameters: --------------------------------------------------------------------- paramsHash: paramsHash to look for retval: modelId, or None if not found
src/nupic/swarming/hypersearch_v2.py
def getModelIDFromParamsHash(self, paramsHash): """ Return the modelID of the model with the given paramsHash, or None if not found. Parameters: --------------------------------------------------------------------- paramsHash: paramsHash to look for retval: modelId, or None if not found ...
def getModelIDFromParamsHash(self, paramsHash): """ Return the modelID of the model with the given paramsHash, or None if not found. Parameters: --------------------------------------------------------------------- paramsHash: paramsHash to look for retval: modelId, or None if not found ...
[ "Return", "the", "modelID", "of", "the", "model", "with", "the", "given", "paramsHash", "or", "None", "if", "not", "found", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L337-L350
[ "def", "getModelIDFromParamsHash", "(", "self", ",", "paramsHash", ")", ":", "entryIdx", "=", "self", ".", "_paramsHashToIndexes", ".", "get", "(", "paramsHash", ",", "None", ")", "if", "entryIdx", "is", "not", "None", ":", "return", "self", ".", "_allResult...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.numModels
Return the total # of models we have in our database (if swarmId is None) or in a specific swarm. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list of encoders in this swarm. For example '__ad...
src/nupic/swarming/hypersearch_v2.py
def numModels(self, swarmId=None, includeHidden=False): """Return the total # of models we have in our database (if swarmId is None) or in a specific swarm. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list o...
def numModels(self, swarmId=None, includeHidden=False): """Return the total # of models we have in our database (if swarmId is None) or in a specific swarm. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list o...
[ "Return", "the", "total", "#", "of", "models", "we", "have", "in", "our", "database", "(", "if", "swarmId", "is", "None", ")", "or", "in", "a", "specific", "swarm", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L352-L379
[ "def", "numModels", "(", "self", ",", "swarmId", "=", "None", ",", "includeHidden", "=", "False", ")", ":", "# Count all models", "if", "includeHidden", ":", "if", "swarmId", "is", "None", ":", "return", "len", "(", "self", ".", "_allResults", ")", "else",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.bestModelIdAndErrScore
Return the model ID of the model with the best result so far and it's score on the optimize metric. If swarm is None, then it returns the global best, otherwise it returns the best for the given swarm for all generatons up to and including genIdx. Parameters: ---------------------------------------...
src/nupic/swarming/hypersearch_v2.py
def bestModelIdAndErrScore(self, swarmId=None, genIdx=None): """Return the model ID of the model with the best result so far and it's score on the optimize metric. If swarm is None, then it returns the global best, otherwise it returns the best for the given swarm for all generatons up to and including ...
def bestModelIdAndErrScore(self, swarmId=None, genIdx=None): """Return the model ID of the model with the best result so far and it's score on the optimize metric. If swarm is None, then it returns the global best, otherwise it returns the best for the given swarm for all generatons up to and including ...
[ "Return", "the", "model", "ID", "of", "the", "model", "with", "the", "best", "result", "so", "far", "and", "it", "s", "score", "on", "the", "optimize", "metric", ".", "If", "swarm", "is", "None", "then", "it", "returns", "the", "global", "best", "other...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L381-L415
[ "def", "bestModelIdAndErrScore", "(", "self", ",", "swarmId", "=", "None", ",", "genIdx", "=", "None", ")", ":", "if", "swarmId", "is", "None", ":", "return", "(", "self", ".", "_bestModelID", ",", "self", ".", "_bestResult", ")", "else", ":", "if", "s...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getParticleInfo
Return particle info for a specific modelId. Parameters: --------------------------------------------------------------------- modelId: which model Id retval: (particleState, modelId, errScore, completed, matured)
src/nupic/swarming/hypersearch_v2.py
def getParticleInfo(self, modelId): """Return particle info for a specific modelId. Parameters: --------------------------------------------------------------------- modelId: which model Id retval: (particleState, modelId, errScore, completed, matured) """ entry = self._allResults[self._...
def getParticleInfo(self, modelId): """Return particle info for a specific modelId. Parameters: --------------------------------------------------------------------- modelId: which model Id retval: (particleState, modelId, errScore, completed, matured) """ entry = self._allResults[self._...
[ "Return", "particle", "info", "for", "a", "specific", "modelId", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L417-L428
[ "def", "getParticleInfo", "(", "self", ",", "modelId", ")", ":", "entry", "=", "self", ".", "_allResults", "[", "self", ".", "_modelIDToIdx", "[", "modelId", "]", "]", "return", "(", "entry", "[", "'modelParams'", "]", "[", "'particleState'", "]", ",", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getParticleInfos
Return a list of particleStates for all particles we know about in the given swarm, their model Ids, and metric results. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list of encoders in this swarm. For...
src/nupic/swarming/hypersearch_v2.py
def getParticleInfos(self, swarmId=None, genIdx=None, completed=None, matured=None, lastDescendent=False): """Return a list of particleStates for all particles we know about in the given swarm, their model Ids, and metric results. Parameters: -------------------------------------...
def getParticleInfos(self, swarmId=None, genIdx=None, completed=None, matured=None, lastDescendent=False): """Return a list of particleStates for all particles we know about in the given swarm, their model Ids, and metric results. Parameters: -------------------------------------...
[ "Return", "a", "list", "of", "particleStates", "for", "all", "particles", "we", "know", "about", "in", "the", "given", "swarm", "their", "model", "Ids", "and", "metric", "results", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L431-L516
[ "def", "getParticleInfos", "(", "self", ",", "swarmId", "=", "None", ",", "genIdx", "=", "None", ",", "completed", "=", "None", ",", "matured", "=", "None", ",", "lastDescendent", "=", "False", ")", ":", "# The indexes of all the models in this swarm. This list ex...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getOrphanParticleInfos
Return a list of particleStates for all particles in the given swarm generation that have been orphaned. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list of encoders in this swarm. For example '__addr...
src/nupic/swarming/hypersearch_v2.py
def getOrphanParticleInfos(self, swarmId, genIdx): """Return a list of particleStates for all particles in the given swarm generation that have been orphaned. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list of en...
def getOrphanParticleInfos(self, swarmId, genIdx): """Return a list of particleStates for all particles in the given swarm generation that have been orphaned. Parameters: --------------------------------------------------------------------- swarmId: A string representation of the sorted list of en...
[ "Return", "a", "list", "of", "particleStates", "for", "all", "particles", "in", "the", "given", "swarm", "generation", "that", "have", "been", "orphaned", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L520-L578
[ "def", "getOrphanParticleInfos", "(", "self", ",", "swarmId", ",", "genIdx", ")", ":", "entryIdxs", "=", "range", "(", "len", "(", "self", ".", "_allResults", ")", ")", "if", "len", "(", "entryIdxs", ")", "==", "0", ":", "return", "(", "[", "]", ",",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getMaturedSwarmGenerations
Return a list of swarm generations that have completed and the best (minimal) errScore seen for each of them. Parameters: --------------------------------------------------------------------- retval: list of tuples. Each tuple is of the form: (swarmId, genIdx, bestErrScore)
src/nupic/swarming/hypersearch_v2.py
def getMaturedSwarmGenerations(self): """Return a list of swarm generations that have completed and the best (minimal) errScore seen for each of them. Parameters: --------------------------------------------------------------------- retval: list of tuples. Each tuple is of the form: ...
def getMaturedSwarmGenerations(self): """Return a list of swarm generations that have completed and the best (minimal) errScore seen for each of them. Parameters: --------------------------------------------------------------------- retval: list of tuples. Each tuple is of the form: ...
[ "Return", "a", "list", "of", "swarm", "generations", "that", "have", "completed", "and", "the", "best", "(", "minimal", ")", "errScore", "seen", "for", "each", "of", "them", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L581-L630
[ "def", "getMaturedSwarmGenerations", "(", "self", ")", ":", "# Return results go in this list", "result", "=", "[", "]", "# For each of the swarm generations which have had model result updates", "# since the last time we were called, see which have completed.", "modifiedSwarmGens", "=",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.firstNonFullGeneration
Return the generation index of the first generation in the given swarm that does not have numParticles particles in it, either still in the running state or completed. This does not include orphaned particles. Parameters: --------------------------------------------------------------------- swarmId...
src/nupic/swarming/hypersearch_v2.py
def firstNonFullGeneration(self, swarmId, minNumParticles): """ Return the generation index of the first generation in the given swarm that does not have numParticles particles in it, either still in the running state or completed. This does not include orphaned particles. Parameters: -------------...
def firstNonFullGeneration(self, swarmId, minNumParticles): """ Return the generation index of the first generation in the given swarm that does not have numParticles particles in it, either still in the running state or completed. This does not include orphaned particles. Parameters: -------------...
[ "Return", "the", "generation", "index", "of", "the", "first", "generation", "in", "the", "given", "swarm", "that", "does", "not", "have", "numParticles", "particles", "in", "it", "either", "still", "in", "the", "running", "state", "or", "completed", ".", "Th...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L632-L657
[ "def", "firstNonFullGeneration", "(", "self", ",", "swarmId", ",", "minNumParticles", ")", ":", "if", "not", "swarmId", "in", "self", ".", "_swarmNumParticlesPerGeneration", ":", "return", "None", "numPsPerGen", "=", "self", ".", "_swarmNumParticlesPerGeneration", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
ResultsDB.getResultsPerChoice
Return a dict of the errors obtained on models that were run with each value from a PermuteChoice variable. For example, if a PermuteChoice variable has the following choices: ['a', 'b', 'c'] The dict will have 3 elements. The keys are the stringified choiceVars, and each value is tuple containi...
src/nupic/swarming/hypersearch_v2.py
def getResultsPerChoice(self, swarmId, maxGenIdx, varName): """ Return a dict of the errors obtained on models that were run with each value from a PermuteChoice variable. For example, if a PermuteChoice variable has the following choices: ['a', 'b', 'c'] The dict will have 3 elements. The keys ...
def getResultsPerChoice(self, swarmId, maxGenIdx, varName): """ Return a dict of the errors obtained on models that were run with each value from a PermuteChoice variable. For example, if a PermuteChoice variable has the following choices: ['a', 'b', 'c'] The dict will have 3 elements. The keys ...
[ "Return", "a", "dict", "of", "the", "errors", "obtained", "on", "models", "that", "were", "run", "with", "each", "value", "from", "a", "PermuteChoice", "variable", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L683-L730
[ "def", "getResultsPerChoice", "(", "self", ",", "swarmId", ",", "maxGenIdx", ",", "varName", ")", ":", "results", "=", "dict", "(", ")", "# Get all the completed particles in this swarm", "(", "allParticles", ",", "_", ",", "resultErrs", ",", "_", ",", "_", ")...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._getStreamDef
Generate stream definition based on
src/nupic/swarming/hypersearch_v2.py
def _getStreamDef(self, modelDescription): """ Generate stream definition based on """ #-------------------------------------------------------------------------- # Generate the string containing the aggregation settings. aggregationPeriod = { 'days': 0, 'hours': 0, 'micr...
def _getStreamDef(self, modelDescription): """ Generate stream definition based on """ #-------------------------------------------------------------------------- # Generate the string containing the aggregation settings. aggregationPeriod = { 'days': 0, 'hours': 0, 'micr...
[ "Generate", "stream", "definition", "based", "on" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1101-L1143
[ "def", "_getStreamDef", "(", "self", ",", "modelDescription", ")", ":", "#--------------------------------------------------------------------------", "# Generate the string containing the aggregation settings.", "aggregationPeriod", "=", "{", "'days'", ":", "0", ",", "'hours'", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2.close
Deletes temporary system objects/files.
src/nupic/swarming/hypersearch_v2.py
def close(self): """Deletes temporary system objects/files. """ if self._tempDir is not None and os.path.isdir(self._tempDir): self.logger.debug("Removing temporary directory %r", self._tempDir) shutil.rmtree(self._tempDir) self._tempDir = None return
def close(self): """Deletes temporary system objects/files. """ if self._tempDir is not None and os.path.isdir(self._tempDir): self.logger.debug("Removing temporary directory %r", self._tempDir) shutil.rmtree(self._tempDir) self._tempDir = None return
[ "Deletes", "temporary", "system", "objects", "/", "files", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1153-L1160
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_tempDir", "is", "not", "None", "and", "os", ".", "path", ".", "isdir", "(", "self", ".", "_tempDir", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Removing temporary directory %r\"", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._readPermutationsFile
Read the permutations file and initialize the following member variables: _predictedField: field name of the field we are trying to predict _permutations: Dict containing the full permutations dictionary. _flattenedPermutations: Dict containing the flattened version of _permu...
src/nupic/swarming/hypersearch_v2.py
def _readPermutationsFile(self, filename, modelDescription): """ Read the permutations file and initialize the following member variables: _predictedField: field name of the field we are trying to predict _permutations: Dict containing the full permutations dictionary. _flatten...
def _readPermutationsFile(self, filename, modelDescription): """ Read the permutations file and initialize the following member variables: _predictedField: field name of the field we are trying to predict _permutations: Dict containing the full permutations dictionary. _flatten...
[ "Read", "the", "permutations", "file", "and", "initialize", "the", "following", "member", "variables", ":", "_predictedField", ":", "field", "name", "of", "the", "field", "we", "are", "trying", "to", "predict", "_permutations", ":", "Dict", "containing", "the", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1162-L1388
[ "def", "_readPermutationsFile", "(", "self", ",", "filename", ",", "modelDescription", ")", ":", "# Open and execute the permutations file", "vars", "=", "{", "}", "permFile", "=", "execfile", "(", "filename", ",", "globals", "(", ")", ",", "vars", ")", "# Read ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._checkForOrphanedModels
If there are any models that haven't been updated in a while, consider them dead, and mark them as hidden in our resultsDB. We also change the paramsHash and particleHash of orphaned models so that we can re-generate that particle and/or model again if we desire. Parameters: -----------------------...
src/nupic/swarming/hypersearch_v2.py
def _checkForOrphanedModels (self): """If there are any models that haven't been updated in a while, consider them dead, and mark them as hidden in our resultsDB. We also change the paramsHash and particleHash of orphaned models so that we can re-generate that particle and/or model again if we desire. ...
def _checkForOrphanedModels (self): """If there are any models that haven't been updated in a while, consider them dead, and mark them as hidden in our resultsDB. We also change the paramsHash and particleHash of orphaned models so that we can re-generate that particle and/or model again if we desire. ...
[ "If", "there", "are", "any", "models", "that", "haven", "t", "been", "updated", "in", "a", "while", "consider", "them", "dead", "and", "mark", "them", "as", "hidden", "in", "our", "resultsDB", ".", "We", "also", "change", "the", "paramsHash", "and", "par...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1463-L1522
[ "def", "_checkForOrphanedModels", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Checking for orphaned models older than %s\"", "%", "(", "self", ".", "_modelOrphanIntervalSecs", ")", ")", "while", "True", ":", "orphanedModelId", "=", "self", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._hsStatePeriodicUpdate
Periodically, check to see if we should remove a certain field combination from evaluation (because it is doing so poorly) or move on to the next sprint (add in more fields). This method is called from _getCandidateParticleAndSwarm(), which is called right before we try and create a new model to run. ...
src/nupic/swarming/hypersearch_v2.py
def _hsStatePeriodicUpdate(self, exhaustedSwarmId=None): """ Periodically, check to see if we should remove a certain field combination from evaluation (because it is doing so poorly) or move on to the next sprint (add in more fields). This method is called from _getCandidateParticleAndSwarm(), whi...
def _hsStatePeriodicUpdate(self, exhaustedSwarmId=None): """ Periodically, check to see if we should remove a certain field combination from evaluation (because it is doing so poorly) or move on to the next sprint (add in more fields). This method is called from _getCandidateParticleAndSwarm(), whi...
[ "Periodically", "check", "to", "see", "if", "we", "should", "remove", "a", "certain", "field", "combination", "from", "evaluation", "(", "because", "it", "is", "doing", "so", "poorly", ")", "or", "move", "on", "to", "the", "next", "sprint", "(", "add", "...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1525-L1698
[ "def", "_hsStatePeriodicUpdate", "(", "self", ",", "exhaustedSwarmId", "=", "None", ")", ":", "if", "self", ".", "_hsState", "is", "None", ":", "self", ".", "_hsState", "=", "HsState", "(", "self", ")", "# Read in current state from the DB", "self", ".", "_hsS...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._getCandidateParticleAndSwarm
Find or create a candidate particle to produce a new model. At any one time, there is an active set of swarms in the current sprint, where each swarm in the sprint represents a particular combination of fields. Ideally, we should try to balance the number of models we have evaluated for each swarm at a...
src/nupic/swarming/hypersearch_v2.py
def _getCandidateParticleAndSwarm (self, exhaustedSwarmId=None): """Find or create a candidate particle to produce a new model. At any one time, there is an active set of swarms in the current sprint, where each swarm in the sprint represents a particular combination of fields. Ideally, we should try t...
def _getCandidateParticleAndSwarm (self, exhaustedSwarmId=None): """Find or create a candidate particle to produce a new model. At any one time, there is an active set of swarms in the current sprint, where each swarm in the sprint represents a particular combination of fields. Ideally, we should try t...
[ "Find", "or", "create", "a", "candidate", "particle", "to", "produce", "a", "new", "model", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L1700-L2016
[ "def", "_getCandidateParticleAndSwarm", "(", "self", ",", "exhaustedSwarmId", "=", "None", ")", ":", "# Cancel search?", "jobCancel", "=", "self", ".", "_cjDAO", ".", "jobGetFields", "(", "self", ".", "_jobID", ",", "[", "'cancel'", "]", ")", "[", "0", "]", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2._okToExit
Test if it's OK to exit this worker. This is only called when we run out of prospective new models to evaluate. This method sees if all models have matured yet. If not, it will sleep for a bit and return False. This will indicate to the hypersearch worker that we should keep running, and check again lat...
src/nupic/swarming/hypersearch_v2.py
def _okToExit(self): """Test if it's OK to exit this worker. This is only called when we run out of prospective new models to evaluate. This method sees if all models have matured yet. If not, it will sleep for a bit and return False. This will indicate to the hypersearch worker that we should keep runn...
def _okToExit(self): """Test if it's OK to exit this worker. This is only called when we run out of prospective new models to evaluate. This method sees if all models have matured yet. If not, it will sleep for a bit and return False. This will indicate to the hypersearch worker that we should keep runn...
[ "Test", "if", "it", "s", "OK", "to", "exit", "this", "worker", ".", "This", "is", "only", "called", "when", "we", "run", "out", "of", "prospective", "new", "models", "to", "evaluate", ".", "This", "method", "sees", "if", "all", "models", "have", "matur...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L2021-L2087
[ "def", "_okToExit", "(", "self", ")", ":", "# Send an update status periodically to the JobTracker so that it doesn't", "# think this worker is dead.", "print", ">>", "sys", ".", "stderr", ",", "\"reporter:status:In hypersearchV2: _okToExit\"", "# Any immature models still running?", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2.createModels
Create one or more new models for evaluation. These should NOT be models that we already know are in progress (i.e. those that have been sent to us via recordModelProgress). We return a list of models to the caller (HypersearchWorker) and if one can be successfully inserted into the models table (i.e. i...
src/nupic/swarming/hypersearch_v2.py
def createModels(self, numModels=1): """Create one or more new models for evaluation. These should NOT be models that we already know are in progress (i.e. those that have been sent to us via recordModelProgress). We return a list of models to the caller (HypersearchWorker) and if one can be successfull...
def createModels(self, numModels=1): """Create one or more new models for evaluation. These should NOT be models that we already know are in progress (i.e. those that have been sent to us via recordModelProgress). We return a list of models to the caller (HypersearchWorker) and if one can be successfull...
[ "Create", "one", "or", "more", "new", "models", "for", "evaluation", ".", "These", "should", "NOT", "be", "models", "that", "we", "already", "know", "are", "in", "progress", "(", "i", ".", "e", ".", "those", "that", "have", "been", "sent", "to", "us", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L2100-L2300
[ "def", "createModels", "(", "self", ",", "numModels", "=", "1", ")", ":", "# Check for and mark orphaned models", "self", ".", "_checkForOrphanedModels", "(", ")", "modelResults", "=", "[", "]", "for", "_", "in", "xrange", "(", "numModels", ")", ":", "candidat...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2.recordModelProgress
Record or update the results for a model. This is called by the HSW whenever it gets results info for another model, or updated results on a model that is still running. The first time this is called for a given modelID, the modelParams will contain the params dict for that model and the modelParamsHas...
src/nupic/swarming/hypersearch_v2.py
def recordModelProgress(self, modelID, modelParams, modelParamsHash, results, completed, completionReason, matured, numRecords): """Record or update the results for a model. This is called by the HSW whenever it gets results info for another model, or updated results on a model that...
def recordModelProgress(self, modelID, modelParams, modelParamsHash, results, completed, completionReason, matured, numRecords): """Record or update the results for a model. This is called by the HSW whenever it gets results info for another model, or updated results on a model that...
[ "Record", "or", "update", "the", "results", "for", "a", "model", ".", "This", "is", "called", "by", "the", "HSW", "whenever", "it", "gets", "results", "info", "for", "another", "model", "or", "updated", "results", "on", "a", "model", "that", "is", "still...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L2302-L2362
[ "def", "recordModelProgress", "(", "self", ",", "modelID", ",", "modelParams", ",", "modelParamsHash", ",", "results", ",", "completed", ",", "completionReason", ",", "matured", ",", "numRecords", ")", ":", "if", "results", "is", "None", ":", "metricResult", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
HypersearchV2.runModel
Run the given model. This runs the model described by 'modelParams'. Periodically, it updates the results seen on the model to the model database using the databaseAO (database Access Object) methods. Parameters: ------------------------------------------------------------------------- modelID...
src/nupic/swarming/hypersearch_v2.py
def runModel(self, modelID, jobID, modelParams, modelParamsHash, jobsDAO, modelCheckpointGUID): """Run the given model. This runs the model described by 'modelParams'. Periodically, it updates the results seen on the model to the model database using the databaseAO (database Access Objec...
def runModel(self, modelID, jobID, modelParams, modelParamsHash, jobsDAO, modelCheckpointGUID): """Run the given model. This runs the model described by 'modelParams'. Periodically, it updates the results seen on the model to the model database using the databaseAO (database Access Objec...
[ "Run", "the", "given", "model", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/hypersearch_v2.py#L2364-L2467
[ "def", "runModel", "(", "self", ",", "modelID", ",", "jobID", ",", "modelParams", ",", "modelParamsHash", ",", "jobsDAO", ",", "modelCheckpointGUID", ")", ":", "# We're going to make an assumption that if we're not using streams, that", "# we also don't need checkpoints saved....
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_escape
Escape commas, tabs, newlines and dashes in a string Commas are encoded as tabs
src/nupic/swarming/permutations_runner.py
def _escape(s): """Escape commas, tabs, newlines and dashes in a string Commas are encoded as tabs """ assert isinstance(s, str), \ "expected %s but got %s; value=%s" % (type(str), type(s), s) s = s.replace("\\", "\\\\") s = s.replace("\n", "\\n") s = s.replace("\t", "\\t") s = s.replace(",", "...
def _escape(s): """Escape commas, tabs, newlines and dashes in a string Commas are encoded as tabs """ assert isinstance(s, str), \ "expected %s but got %s; value=%s" % (type(str), type(s), s) s = s.replace("\\", "\\\\") s = s.replace("\n", "\\n") s = s.replace("\t", "\\t") s = s.replace(",", "...
[ "Escape", "commas", "tabs", "newlines", "and", "dashes", "in", "a", "string" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L101-L112
[ "def", "_escape", "(", "s", ")", ":", "assert", "isinstance", "(", "s", ",", "str", ")", ",", "\"expected %s but got %s; value=%s\"", "%", "(", "type", "(", "str", ")", ",", "type", "(", "s", ")", ",", "s", ")", "s", "=", "s", ".", "replace", "(", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_engineServicesRunning
Return true if the engine services are running
src/nupic/swarming/permutations_runner.py
def _engineServicesRunning(): """ Return true if the engine services are running """ process = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE) stdout = process.communicate()[0] result = process.returncode if result != 0: raise RuntimeError("Unable to check for running client job manager") # ...
def _engineServicesRunning(): """ Return true if the engine services are running """ process = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE) stdout = process.communicate()[0] result = process.returncode if result != 0: raise RuntimeError("Unable to check for running client job manager") # ...
[ "Return", "true", "if", "the", "engine", "services", "are", "running" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L116-L133
[ "def", "_engineServicesRunning", "(", ")", ":", "process", "=", "subprocess", ".", "Popen", "(", "[", "\"ps\"", ",", "\"aux\"", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", "stdout", "=", "process", ".", "communicate", "(", ")", "[", "0", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
runWithConfig
Starts a swarm, given an dictionary configuration. @param swarmConfig {dict} A complete [swarm description](http://nupic.docs.numenta.org/0.7.0.dev0/guides/swarming/running.html#the-swarm-description) object. @param outDir {string} Optional path to write swarm details (defaults to current w...
src/nupic/swarming/permutations_runner.py
def runWithConfig(swarmConfig, options, outDir=None, outputLabel="default", permWorkDir=None, verbosity=1): """ Starts a swarm, given an dictionary configuration. @param swarmConfig {dict} A complete [swarm description](http://nupic.docs.numenta.org/0.7.0.dev0/guides/swarming/r...
def runWithConfig(swarmConfig, options, outDir=None, outputLabel="default", permWorkDir=None, verbosity=1): """ Starts a swarm, given an dictionary configuration. @param swarmConfig {dict} A complete [swarm description](http://nupic.docs.numenta.org/0.7.0.dev0/guides/swarming/r...
[ "Starts", "a", "swarm", "given", "an", "dictionary", "configuration", ".", "@param", "swarmConfig", "{", "dict", "}", "A", "complete", "[", "swarm", "description", "]", "(", "http", ":", "//", "nupic", ".", "docs", ".", "numenta", ".", "org", "/", "0", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L234-L271
[ "def", "runWithConfig", "(", "swarmConfig", ",", "options", ",", "outDir", "=", "None", ",", "outputLabel", "=", "\"default\"", ",", "permWorkDir", "=", "None", ",", "verbosity", "=", "1", ")", ":", "global", "g_currentVerbosityLevel", "g_currentVerbosityLevel", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
runWithJsonFile
Starts a swarm, given a path to a JSON file containing configuration. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @param expJsonFilePath {string} Path to a JSON file containing the complete [swarm desc...
src/nupic/swarming/permutations_runner.py
def runWithJsonFile(expJsonFilePath, options, outputLabel, permWorkDir): """ Starts a swarm, given a path to a JSON file containing configuration. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @param expJsonFilePath {string} Path to...
def runWithJsonFile(expJsonFilePath, options, outputLabel, permWorkDir): """ Starts a swarm, given a path to a JSON file containing configuration. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @param expJsonFilePath {string} Path to...
[ "Starts", "a", "swarm", "given", "a", "path", "to", "a", "JSON", "file", "containing", "configuration", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L275-L304
[ "def", "runWithJsonFile", "(", "expJsonFilePath", ",", "options", ",", "outputLabel", ",", "permWorkDir", ")", ":", "if", "\"verbosityCount\"", "in", "options", ":", "verbosity", "=", "options", "[", "\"verbosityCount\"", "]", "del", "options", "[", "\"verbosityCo...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
runWithPermutationsScript
Starts a swarm, given a path to a permutations.py script. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @param permutationsFilePath {string} Path to permutations.py. @param options {dict} CLI options. @param outputLabel {string} Lab...
src/nupic/swarming/permutations_runner.py
def runWithPermutationsScript(permutationsFilePath, options, outputLabel, permWorkDir): """ Starts a swarm, given a path to a permutations.py script. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @pa...
def runWithPermutationsScript(permutationsFilePath, options, outputLabel, permWorkDir): """ Starts a swarm, given a path to a permutations.py script. This function is meant to be used with a CLI wrapper that passes command line arguments in through the options parameter. @pa...
[ "Starts", "a", "swarm", "given", "a", "path", "to", "a", "permutations", ".", "py", "script", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L308-L341
[ "def", "runWithPermutationsScript", "(", "permutationsFilePath", ",", "options", ",", "outputLabel", ",", "permWorkDir", ")", ":", "global", "g_currentVerbosityLevel", "if", "\"verbosityCount\"", "in", "options", ":", "g_currentVerbosityLevel", "=", "options", "[", "\"v...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_backupFile
Back up a file Parameters: ---------------------------------------------------------------------- retval: Filepath of the back-up
src/nupic/swarming/permutations_runner.py
def _backupFile(filePath): """Back up a file Parameters: ---------------------------------------------------------------------- retval: Filepath of the back-up """ assert os.path.exists(filePath) stampNum = 0 (prefix, suffix) = os.path.splitext(filePath) while True: backupPath = "%s.%d%s...
def _backupFile(filePath): """Back up a file Parameters: ---------------------------------------------------------------------- retval: Filepath of the back-up """ assert os.path.exists(filePath) stampNum = 0 (prefix, suffix) = os.path.splitext(filePath) while True: backupPath = "%s.%d%s...
[ "Back", "up", "a", "file" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1862-L1880
[ "def", "_backupFile", "(", "filePath", ")", ":", "assert", "os", ".", "path", ".", "exists", "(", "filePath", ")", "stampNum", "=", "0", "(", "prefix", ",", "suffix", ")", "=", "os", ".", "path", ".", "splitext", "(", "filePath", ")", "while", "True"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_iterModels
Creates an iterator that returns ModelInfo elements for the given modelIDs WARNING: The order of ModelInfo elements returned by the iterator may not match the order of the given modelIDs Parameters: ---------------------------------------------------------------------- modelIDs: A s...
src/nupic/swarming/permutations_runner.py
def _iterModels(modelIDs): """Creates an iterator that returns ModelInfo elements for the given modelIDs WARNING: The order of ModelInfo elements returned by the iterator may not match the order of the given modelIDs Parameters: ------------------------------------------------------------...
def _iterModels(modelIDs): """Creates an iterator that returns ModelInfo elements for the given modelIDs WARNING: The order of ModelInfo elements returned by the iterator may not match the order of the given modelIDs Parameters: ------------------------------------------------------------...
[ "Creates", "an", "iterator", "that", "returns", "ModelInfo", "elements", "for", "the", "given", "modelIDs" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1898-L2041
[ "def", "_iterModels", "(", "modelIDs", ")", ":", "class", "ModelInfoIterator", "(", "object", ")", ":", "\"\"\"ModelInfo iterator implementation class\n \"\"\"", "# Maximum number of ModelInfo elements to load into cache whenever", "# cache empties", "__CACHE_LIMIT", "=", "1000"...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.pickupSearch
Pick up the latest search from a saved jobID and monitor it to completion Parameters: ---------------------------------------------------------------------- retval: nothing
src/nupic/swarming/permutations_runner.py
def pickupSearch(self): """Pick up the latest search from a saved jobID and monitor it to completion Parameters: ---------------------------------------------------------------------- retval: nothing """ self.__searchJob = self.loadSavedHyperSearchJob( permWorkDir=self._options["pe...
def pickupSearch(self): """Pick up the latest search from a saved jobID and monitor it to completion Parameters: ---------------------------------------------------------------------- retval: nothing """ self.__searchJob = self.loadSavedHyperSearchJob( permWorkDir=self._options["pe...
[ "Pick", "up", "the", "latest", "search", "from", "a", "saved", "jobID", "and", "monitor", "it", "to", "completion", "Parameters", ":", "----------------------------------------------------------------------", "retval", ":", "nothing" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L442-L453
[ "def", "pickupSearch", "(", "self", ")", ":", "self", ".", "__searchJob", "=", "self", ".", "loadSavedHyperSearchJob", "(", "permWorkDir", "=", "self", ".", "_options", "[", "\"permWorkDir\"", "]", ",", "outputLabel", "=", "self", ".", "_options", "[", "\"ou...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.monitorSearchJob
Parameters: ---------------------------------------------------------------------- retval: nothing
src/nupic/swarming/permutations_runner.py
def monitorSearchJob(self): """ Parameters: ---------------------------------------------------------------------- retval: nothing """ assert self.__searchJob is not None jobID = self.__searchJob.getJobID() startTime = time.time() lastUpdateTime = datetime.now() # Moni...
def monitorSearchJob(self): """ Parameters: ---------------------------------------------------------------------- retval: nothing """ assert self.__searchJob is not None jobID = self.__searchJob.getJobID() startTime = time.time() lastUpdateTime = datetime.now() # Moni...
[ "Parameters", ":", "----------------------------------------------------------------------", "retval", ":", "nothing" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L457-L614
[ "def", "monitorSearchJob", "(", "self", ")", ":", "assert", "self", ".", "__searchJob", "is", "not", "None", "jobID", "=", "self", ".", "__searchJob", ".", "getJobID", "(", ")", "startTime", "=", "time", ".", "time", "(", ")", "lastUpdateTime", "=", "dat...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner._launchWorkers
Launch worker processes to execute the given command line Parameters: ----------------------------------------------- cmdLine: The command line for each worker numWorkers: number of workers to launch
src/nupic/swarming/permutations_runner.py
def _launchWorkers(self, cmdLine, numWorkers): """ Launch worker processes to execute the given command line Parameters: ----------------------------------------------- cmdLine: The command line for each worker numWorkers: number of workers to launch """ self._workers = [] for i in ran...
def _launchWorkers(self, cmdLine, numWorkers): """ Launch worker processes to execute the given command line Parameters: ----------------------------------------------- cmdLine: The command line for each worker numWorkers: number of workers to launch """ self._workers = [] for i in ran...
[ "Launch", "worker", "processes", "to", "execute", "the", "given", "command", "line" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L618-L635
[ "def", "_launchWorkers", "(", "self", ",", "cmdLine", ",", "numWorkers", ")", ":", "self", ".", "_workers", "=", "[", "]", "for", "i", "in", "range", "(", "numWorkers", ")", ":", "stdout", "=", "tempfile", ".", "NamedTemporaryFile", "(", "delete", "=", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.__startSearch
Starts HyperSearch as a worker or runs it inline for the "dryRun" action Parameters: ---------------------------------------------------------------------- retval: the new _HyperSearchJob instance representing the HyperSearch job
src/nupic/swarming/permutations_runner.py
def __startSearch(self): """Starts HyperSearch as a worker or runs it inline for the "dryRun" action Parameters: ---------------------------------------------------------------------- retval: the new _HyperSearchJob instance representing the HyperSearch job """ # Thi...
def __startSearch(self): """Starts HyperSearch as a worker or runs it inline for the "dryRun" action Parameters: ---------------------------------------------------------------------- retval: the new _HyperSearchJob instance representing the HyperSearch job """ # Thi...
[ "Starts", "HyperSearch", "as", "a", "worker", "or", "runs", "it", "inline", "for", "the", "dryRun", "action" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L639-L694
[ "def", "__startSearch", "(", "self", ")", ":", "# This search uses a pre-existing permutations script", "params", "=", "_ClientJobUtils", ".", "makeSearchJobParamsDict", "(", "options", "=", "self", ".", "_options", ",", "forRunning", "=", "True", ")", "if", "self", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.generateReport
Prints all available results in the given HyperSearch job and emits model information to the permutations report csv. The job may be completed or still in progress. Parameters: ---------------------------------------------------------------------- options: NupicRunPermutations options dict ...
src/nupic/swarming/permutations_runner.py
def generateReport(cls, options, replaceReport, hyperSearchJob, metricsKeys): """Prints all available results in the given HyperSearch job and emits model information to the permutations report csv. The job may be completed...
def generateReport(cls, options, replaceReport, hyperSearchJob, metricsKeys): """Prints all available results in the given HyperSearch job and emits model information to the permutations report csv. The job may be completed...
[ "Prints", "all", "available", "results", "in", "the", "given", "HyperSearch", "job", "and", "emits", "model", "information", "to", "the", "permutations", "report", "csv", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L743-L1031
[ "def", "generateReport", "(", "cls", ",", "options", ",", "replaceReport", ",", "hyperSearchJob", ",", "metricsKeys", ")", ":", "# Load _HyperSearchJob instance from storage, if not provided", "if", "hyperSearchJob", "is", "None", ":", "hyperSearchJob", "=", "cls", ".",...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.loadSavedHyperSearchJob
Instantiates a _HyperSearchJob instance from info saved in file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobID retval: _HyperSearchJob...
src/nupic/swarming/permutations_runner.py
def loadSavedHyperSearchJob(cls, permWorkDir, outputLabel): """Instantiates a _HyperSearchJob instance from info saved in file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporat...
def loadSavedHyperSearchJob(cls, permWorkDir, outputLabel): """Instantiates a _HyperSearchJob instance from info saved in file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporat...
[ "Instantiates", "a", "_HyperSearchJob", "instance", "from", "info", "saved", "in", "file" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1036-L1049
[ "def", "loadSavedHyperSearchJob", "(", "cls", ",", "permWorkDir", ",", "outputLabel", ")", ":", "jobID", "=", "cls", ".", "__loadHyperSearchJobID", "(", "permWorkDir", "=", "permWorkDir", ",", "outputLabel", "=", "outputLabel", ")", "searchJob", "=", "_HyperSearch...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.__saveHyperSearchJobID
Saves the given _HyperSearchJob instance's jobID to file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobID hyperSearchJob: _HyperSearchJob...
src/nupic/swarming/permutations_runner.py
def __saveHyperSearchJobID(cls, permWorkDir, outputLabel, hyperSearchJob): """Saves the given _HyperSearchJob instance's jobID to file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string fo...
def __saveHyperSearchJobID(cls, permWorkDir, outputLabel, hyperSearchJob): """Saves the given _HyperSearchJob instance's jobID to file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string fo...
[ "Saves", "the", "given", "_HyperSearchJob", "instance", "s", "jobID", "to", "file" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1054-L1074
[ "def", "__saveHyperSearchJobID", "(", "cls", ",", "permWorkDir", ",", "outputLabel", ",", "hyperSearchJob", ")", ":", "jobID", "=", "hyperSearchJob", ".", "getJobID", "(", ")", "filePath", "=", "cls", ".", "__getHyperSearchJobIDFilePath", "(", "permWorkDir", "=", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.__loadHyperSearchJobID
Loads a saved jobID from file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobID retval: HyperSearch jobID; raises exception if not fou...
src/nupic/swarming/permutations_runner.py
def __loadHyperSearchJobID(cls, permWorkDir, outputLabel): """Loads a saved jobID from file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobI...
def __loadHyperSearchJobID(cls, permWorkDir, outputLabel): """Loads a saved jobID from file Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobI...
[ "Loads", "a", "saved", "jobID", "from", "file" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1079-L1096
[ "def", "__loadHyperSearchJobID", "(", "cls", ",", "permWorkDir", ",", "outputLabel", ")", ":", "filePath", "=", "cls", ".", "__getHyperSearchJobIDFilePath", "(", "permWorkDir", "=", "permWorkDir", ",", "outputLabel", "=", "outputLabel", ")", "jobID", "=", "None", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchRunner.__getHyperSearchJobIDFilePath
Returns filepath where to store HyperSearch JobID Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobID retval: Filepath where to store Hyper...
src/nupic/swarming/permutations_runner.py
def __getHyperSearchJobIDFilePath(cls, permWorkDir, outputLabel): """Returns filepath where to store HyperSearch JobID Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into...
def __getHyperSearchJobIDFilePath(cls, permWorkDir, outputLabel): """Returns filepath where to store HyperSearch JobID Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into...
[ "Returns", "filepath", "where", "to", "store", "HyperSearch", "JobID" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1101-L1117
[ "def", "__getHyperSearchJobIDFilePath", "(", "cls", ",", "permWorkDir", ",", "outputLabel", ")", ":", "# Get the base path and figure out the path of the report file.", "basePath", "=", "permWorkDir", "# Form the name of the output csv file that will contain all the results", "filename...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_ReportCSVWriter.emit
Emit model info to csv file Parameters: ---------------------------------------------------------------------- modelInfo: _NupicModelInfo instance retval: nothing
src/nupic/swarming/permutations_runner.py
def emit(self, modelInfo): """Emit model info to csv file Parameters: ---------------------------------------------------------------------- modelInfo: _NupicModelInfo instance retval: nothing """ # Open/init csv file, if needed if self.__csvFileObj is None: # sets up...
def emit(self, modelInfo): """Emit model info to csv file Parameters: ---------------------------------------------------------------------- modelInfo: _NupicModelInfo instance retval: nothing """ # Open/init csv file, if needed if self.__csvFileObj is None: # sets up...
[ "Emit", "model", "info", "to", "csv", "file" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1212-L1267
[ "def", "emit", "(", "self", ",", "modelInfo", ")", ":", "# Open/init csv file, if needed", "if", "self", ".", "__csvFileObj", "is", "None", ":", "# sets up self.__sortedVariableNames and self.__csvFileObj", "self", ".", "__openAndInitCSVFile", "(", "modelInfo", ")", "cs...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_ReportCSVWriter.finalize
Close file and print report/backup csv file paths Parameters: ---------------------------------------------------------------------- retval: nothing
src/nupic/swarming/permutations_runner.py
def finalize(self): """Close file and print report/backup csv file paths Parameters: ---------------------------------------------------------------------- retval: nothing """ if self.__csvFileObj is not None: # Done with file self.__csvFileObj.close() self.__csvFileOb...
def finalize(self): """Close file and print report/backup csv file paths Parameters: ---------------------------------------------------------------------- retval: nothing """ if self.__csvFileObj is not None: # Done with file self.__csvFileObj.close() self.__csvFileOb...
[ "Close", "file", "and", "print", "report", "/", "backup", "csv", "file", "paths" ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1271-L1289
[ "def", "finalize", "(", "self", ")", ":", "if", "self", ".", "__csvFileObj", "is", "not", "None", ":", "# Done with file", "self", ".", "__csvFileObj", ".", "close", "(", ")", "self", ".", "__csvFileObj", "=", "None", "print", "\"Report csv saved in %s\"", "...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_ReportCSVWriter.__openAndInitCSVFile
- Backs up old report csv file; - opens the report csv file in append or overwrite mode (per self.__replaceReport); - emits column fields; - sets up self.__sortedVariableNames, self.__csvFileObj, self.__backupCSVPath, and self.__reportCSVPath Parameters: --------------------------------...
src/nupic/swarming/permutations_runner.py
def __openAndInitCSVFile(self, modelInfo): """ - Backs up old report csv file; - opens the report csv file in append or overwrite mode (per self.__replaceReport); - emits column fields; - sets up self.__sortedVariableNames, self.__csvFileObj, self.__backupCSVPath, and self.__reportCSVPat...
def __openAndInitCSVFile(self, modelInfo): """ - Backs up old report csv file; - opens the report csv file in append or overwrite mode (per self.__replaceReport); - emits column fields; - sets up self.__sortedVariableNames, self.__csvFileObj, self.__backupCSVPath, and self.__reportCSVPat...
[ "-", "Backs", "up", "old", "report", "csv", "file", ";", "-", "opens", "the", "report", "csv", "file", "in", "append", "or", "overwrite", "mode", "(", "per", "self", ".", "__replaceReport", ")", ";", "-", "emits", "column", "fields", ";", "-", "sets", ...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1293-L1347
[ "def", "__openAndInitCSVFile", "(", "self", ",", "modelInfo", ")", ":", "# Get the base path and figure out the path of the report file.", "basePath", "=", "self", ".", "__outputDirAbsPath", "# Form the name of the output csv file that will contain all the results", "reportCSVName", ...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_NupicJob.getJobStatus
Parameters: ---------------------------------------------------------------------- workers: If this job was launched outside of the nupic job engine, then this is an array of subprocess Popen instances, one for each worker retval: _NupicJob.JobStatus instance
src/nupic/swarming/permutations_runner.py
def getJobStatus(self, workers): """ Parameters: ---------------------------------------------------------------------- workers: If this job was launched outside of the nupic job engine, then this is an array of subprocess Popen instances, one for each worker retval: _NupicJo...
def getJobStatus(self, workers): """ Parameters: ---------------------------------------------------------------------- workers: If this job was launched outside of the nupic job engine, then this is an array of subprocess Popen instances, one for each worker retval: _NupicJo...
[ "Parameters", ":", "----------------------------------------------------------------------", "workers", ":", "If", "this", "job", "was", "launched", "outside", "of", "the", "nupic", "job", "engine", "then", "this", "is", "an", "array", "of", "subprocess", "Popen", "in...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1387-L1397
[ "def", "getJobStatus", "(", "self", ",", "workers", ")", ":", "jobInfo", "=", "self", ".", "JobStatus", "(", "self", ".", "__nupicJobID", ",", "workers", ")", "return", "jobInfo" ]
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_HyperSearchJob.queryModelIDs
Queuries DB for model IDs of all currently instantiated models associated with this HyperSearch job. See also: _iterModels() Parameters: ---------------------------------------------------------------------- retval: A sequence of Nupic modelIDs
src/nupic/swarming/permutations_runner.py
def queryModelIDs(self): """Queuries DB for model IDs of all currently instantiated models associated with this HyperSearch job. See also: _iterModels() Parameters: ---------------------------------------------------------------------- retval: A sequence of Nupic modelIDs """ j...
def queryModelIDs(self): """Queuries DB for model IDs of all currently instantiated models associated with this HyperSearch job. See also: _iterModels() Parameters: ---------------------------------------------------------------------- retval: A sequence of Nupic modelIDs """ j...
[ "Queuries", "DB", "for", "model", "IDs", "of", "all", "currently", "instantiated", "models", "associated", "with", "this", "HyperSearch", "job", "." ]
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1743-L1757
[ "def", "queryModelIDs", "(", "self", ")", ":", "jobID", "=", "self", ".", "getJobID", "(", ")", "modelCounterPairs", "=", "_clientJobsDB", "(", ")", ".", "modelsGetUpdateCounters", "(", "jobID", ")", "modelIDs", "=", "tuple", "(", "x", "[", "0", "]", "fo...
5922fafffdccc8812e72b3324965ad2f7d4bbdad
valid
_ClientJobUtils.makeSearchJobParamsDict
Constructs a dictionary of HyperSearch parameters suitable for converting to json and passing as the params argument to ClientJobsDAO.jobInsert() Parameters: ---------------------------------------------------------------------- options: NupicRunPermutations options dict forRunning: True ...
src/nupic/swarming/permutations_runner.py
def makeSearchJobParamsDict(cls, options, forRunning=False): """Constructs a dictionary of HyperSearch parameters suitable for converting to json and passing as the params argument to ClientJobsDAO.jobInsert() Parameters: ---------------------------------------------------------------------- options...
def makeSearchJobParamsDict(cls, options, forRunning=False): """Constructs a dictionary of HyperSearch parameters suitable for converting to json and passing as the params argument to ClientJobsDAO.jobInsert() Parameters: ---------------------------------------------------------------------- options...
[ "Constructs", "a", "dictionary", "of", "HyperSearch", "parameters", "suitable", "for", "converting", "to", "json", "and", "passing", "as", "the", "params", "argument", "to", "ClientJobsDAO", ".", "jobInsert", "()", "Parameters", ":", "---------------------------------...
numenta/nupic
python
https://github.com/numenta/nupic/blob/5922fafffdccc8812e72b3324965ad2f7d4bbdad/src/nupic/swarming/permutations_runner.py#L1783-L1828
[ "def", "makeSearchJobParamsDict", "(", "cls", ",", "options", ",", "forRunning", "=", "False", ")", ":", "if", "options", "[", "\"searchMethod\"", "]", "==", "\"v2\"", ":", "hsVersion", "=", "\"v2\"", "else", ":", "raise", "Exception", "(", "\"Unsupported sear...
5922fafffdccc8812e72b3324965ad2f7d4bbdad