Skip to content

AdaptiveTimeScaleProbe

Pete Schultz edited this page Aug 25, 2016 · 2 revisions

This page describes how to change a params file now that the adaptive time scale routine has been split out from HyPerCol and put into its own probe (currently in the develop branch).

If dtAdaptController in the HyPerCol is NULL, all you need to do is make sure that all the obsolete parameters have been removed from HyPerCol. They are, dtAdaptController, dtAdaptFlag, dtAdaptTriggerLayerName, dtAdaptTriggerOffset, dtScaleMax, dtScaleMax2, dtScaleMin, dtMinToleratedTimeScale, dtChangeMax, and dtChangeMin, writeTimescales, and writeTimeScaleFieldnames.

If dtAdaptController is not null and points to a probe, you will need to create a new AdaptiveTimeScaleProbe, and give it the following parameters:

  • targetName is the name of the probe named in the HyPerCol dtAdaptController parameter. This parameter is required.
  • probeOutputFile is the path to the file that contains the information that used to be printed to HyPerCol_timescales.txt. Relative paths are relative to the outputPath directory. Default is null, in which case the information is printed to standard output.
  • triggerLayerName is the name of the layer named in the HyPerCol dtAdaptTriggerLayerName parameter. Default is null, in which case there is no triggering.
  • triggerOffset is the dtAdaptTriggerOffset parameter from HyPerCol. It is only read if triggerLayerName is set. Default is 0.
  • baseMax is the HyPerCol dtScaleMax parameter. Default is 1.
  • baseMin is the HyPerCol dtScaleMin parameter. Default is 1.
  • tauFactor is the HyPerCol dtChangeMax parameter. Default is 1.
  • growthFactor is the HyPerCol dtChangeMin parameter. Default is 1.
  • writeTimeScales is the HyPerCol writeTimescales flag. Default is true.
  • writeTimeScaleFieldnames is the HyPerCol flag of the same name. Default is true.

Note that dtAdaptFlag, dtScaleMax2, and dtMinToleratedTimeScale have been removed entirely.

Finally, add the parameter adaptiveTimeScaleProbe, with the name of the new AdaptiveTimeScaleProbe, to each HyPerLCALayer, MomentumLCALayer and ISTALayer in the column.

For example, if the old params file has

HyPerCol "column" = {
    nx = 1024;
    ny = 256;
    nbatch = 1;
    dt = 1;
    dtAdaptFlag = true;
    dtAdaptController = "S1EnergyProbe";
    useAdaptMethodExp1stOrder = true;
    dtAdaptTriggerOffset = 0;
    dtAdaptTriggerLayerName = "Image";
    dtScaleMax = 0.011;
    dtScaleMin = 0.01;
    dtChangeMax = 0.1;
    dtChangeMin = 0.01;
    dtMinToleratedTimeScale = 0;
    writeTimescales = true;
    writeTimeScaleFieldnames = true;
    randomSeed = 1234567890;
    startTime = 0.0;
    stopTime = 250000000;
    progressInterval = 50;
    errorOnNotANumber = false;
    writeProgressToErr = true;
    verifyWrites = false;
    outputPath = "output/";
    printParamsFilename = "pv.params";
    initializeFromCheckpointDir = "";
    checkpointWrite = false;
};
...
HyPerLCALayer "S1" = {
    clearGSynInterval = 0;
    valueBC = 0;
    mirrorBCflag = false;
    timeConstantTau = 200;
    AMin = 0;
    selfInteract = true;
    InitVType = "ConstantV";
    phase = 2;
    nyScale = 0.5;
    valueV = 0.05;
    AMax = infinity;
    nxScale = 0.5;
    writeStep = -1;
    writeSparseValues = true;
    nf = 64;
    initialWriteTime = 100000;
    sparseLayer = true;
    initializeFromCheckpointFlag = false;
    VThresh = 0.05;
    AShift = 0;
    VWidth = 0;
    updateGpu = false;
};

then the new params file should have

HyPerCol "column" = {
    nx = 1024;
    ny = 256;
    nbatch = 1;
    dt = 1;
                                                   // several params removed
    randomSeed = 1234567890;
    startTime = 0.0;
    stopTime = 250000000;
    progressInterval = 50;
    errorOnNotANumber = false;
    writeProgressToErr = true;
    verifyWrites = false;
    outputPath = "output/";
    printParamsFilename = "pv.params";
    initializeFromCheckpointDir = "";
    checkpointWrite = false;
};
...
HyPerLCALayer "S1" = {
    clearGSynInterval = 0;
    valueBC = 0;
    mirrorBCflag = false;
    timeConstantTau = 200;
    AMin = 0;
    selfInteract = true;
    InitVType = "ConstantV";
    phase = 2;
    nyScale = 0.5;
    valueV = 0.05;
    AMax = infinity;
    nxScale = 0.5;
    writeStep = -1;
    writeSparseValues = true;
    nf = 64;
    initialWriteTime = 100000;
    sparseLayer = true;
    initializeFromCheckpointFlag = false;
    VThresh = 0.05;
    AShift = 0;
    VWidth = 0;
    updateGpu = false;
    adaptiveTimeScaleProbe = "AdaptiveTimeScales"; // new parameter
};
...
AdaptiveTimeScaleProbe "AdaptiveTimeScales" = {    // new parameter group
    targetName = "S1EnergyProbe";                  // formerly dtAdaptController
    probeOutputFile = "AdaptiveTimeScales.txt";
    triggerLayerName = "Image";                    // formerly dtAdaptTriggerLayerName
    triggerOffset = 0;                             // formerly dtAdaptTriggerOffset
    baseMax = 0.011;                               // formerly dtScaleMax
    baseMin = 0.01;                                // formerly dtScaleMin
    tauFactor = 0.1;                               // formerly dtChangeMax
    growthFactor = 0.01;                           // formerly dtChangeMin
    writeTimeScales = true;                        // formerly writeTimeScales
    writeTimeScaleFieldnames = true;
};