% Script to accompany program SigmoidLocalBayes for locally Bayesian % learning. John Kruschke. clear clc % Set each of these flags to 1 to include that type of procedure, or to 0 % to exclude that type of procedure. CrashTestDummyflag = 1; % for testing Hiliflag = 0; % Highlighting Blockflag = 0; % Blocking BackBlockflag = 0; % Backward blocking ForUnoverflag = 0; % Forward Unovershadowing Unoverflag = 0; % Unovershadowing CondInhibflag = 0; % Conditioned Inhibition BackCondInhibflag = 0; % Backward Conditioned Inhibition % Set this to 1 for all runs local updating, or to 0 for all runs global % updating. localUpdateFlag = 1 ; % For explanation of what the variables in each procedure do, see % documentation in the program SigmoidLocalBayes. if CrashTestDummyflag RunName = 'SigLB_CrashTestDummy' ; localUpdate = localUpdateFlag ; CueLabel = { 'PE' 'I' 'PL' } ; OutLabel = { 'E' } ; wOutMeanString = '0.0 * wOutSD'; TrainItem = [ ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ... ]; TestItem = [ ... 1 1 0 ; ... 0 1 1 ; ... 0 1 0 ; ... 1 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if Hiliflag RunName = 'SigLB_Hili' ; localUpdate = localUpdateFlag ; CueLabel = { 'PE' 'I' 'PL' } ; OutLabel = { 'E' } ; wOutMeanString = '0.0 * wOutSD'; TrainItem = [ ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 1 1 0 1 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ; ... 0 1 1 0 ... ]; TestItem = [ ... 1 1 0 ; ... 0 1 1 ; ... 0 1 0 ; ... 1 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if Blockflag RunName = 'SigLB_Block' ; localUpdate = localUpdateFlag ; CueLabel = { 'A' 'B' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if BackBlockflag RunName = 'SigLB_BackBlock' ; localUpdate = localUpdateFlag ; CueLabel = { 'A' 'B' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if ForUnoverflag RunName = 'SigLB_ForUnover' ; localUpdate = localUpdateFlag ; CueLabel = { 'A' 'B' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if Unoverflag RunName = 'SigLB_Unover' ; localUpdate = localUpdateFlag ; CueLabel = { 'A' 'B' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 1 1 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ; ... 1 0 0 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, TestItem, wOutMeanString ) end if CondInhibflag RunName = 'SigLB_CondInhib' ; localUpdate = localUpdateFlag ; CueLabel = { 'E' 'I' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end if BackCondInhibflag RunName = 'SigLB_BackCondInhib' ; localUpdate = localUpdateFlag ; CueLabel = { 'E' 'I' } ; OutLabel = { 'X' } ; wOutMeanString = '-1.0 * wOutSD' ; TrainItem = [ ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 1 0 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ; ... 1 0 1 ... ]; TestItem = [ ... 1 1 ; ... 1 0 ; ... 0 1 ... ]; SigmoidLocalBayes( RunName, localUpdate, CueLabel, OutLabel, TrainItem, ... TestItem, wOutMeanString ) end