diff --git a/aigame3.py b/aigame3.py new file mode 100644 index 00000000..a6223cb6 --- /dev/null +++ b/aigame3.py @@ -0,0 +1,503 @@ +""" +AIGame: connects OpenAI gym game to the model (V1-M1-RL) # Pong-specific +Adapted from arm.py +Original Version: 2015jan28 by salvadordura@gmail.com +Modified Version: 2019oct1 by haroon.anwar@gmail.com +Modified 2019-2020 samn +Modified 2020 davidd +-------------------------- +AIGame2: connects OpenAI gym game to the model (V1-M1-RL) for Breakout environment +Adapted from AIGame.py +Original Version: 2020jul7 by davidd +-------------------------- +AIGame3: connects OpenAI gym game to the model (V1-M1-RL) # Universal/Combo of Breakout + Pong +Adapted from AIGame.py and AIGame2.py +Original Version: 2020aug4 by davidd +""" +#Original imports from aigame.py +from neuron import h +from pylab import concatenate, figure, show, ion, ioff, pause,xlabel, ylabel, plot, Circle, sqrt, arctan, arctan2, close +from copy import copy, deepcopy +from random import uniform, seed, sample, randint +from matplotlib import pyplot as plt +import random +import numpy as np +from skimage.transform import downscale_local_mean, resize +from skimage.color import rgb2gray +import json +import gym +import sys +from gym import wrappers +from time import time +from collections import OrderedDict +from imgutils import getoptflow +from imgutils import getObjectsBoundingBoxes, getObjectMotionDirection +import cv2 +from centroidtracker import CentroidTracker +from conf import dconf + +# make the environment - env is global so that it only gets created on a single node (important when using MPI with > 1 node) +#Allows option for simulated environment +useSimulatedEnv = False +try: + if 'useSimulatedEnv' in dconf: useSimulatedEnv = dconf['useSimulatedEnv'] + if useSimulatedEnv: + from simulateBreakout import simulateBreakout #simulatedBreakout doesn't exist yet, but in case it becomes necessary + breakout = simulateBreakout() + else: + if 'frameskip' in dconf['env']: + env = gym.make(dconf['env']['name'],frameskip=dconf['env']['frameskip'],repeat_action_probability=0.) + else: + env = gym.make(dconf['env']['name'],repeat_action_probability=0.) + if dconf['env']['savemp4']: env = wrappers.Monitor(env, './videos/' + dconf['sim']['name'] + '/',force=True) + env.reset() +except: + print('Exception in makeENV') + env = gym.make('Pong-v0',frameskip=2,repeat_action_probability=0.) + env = wrappers.Monitor(env, './videos/' + str(time()) + '/',force=True) + env.reset() + +# Specifics per game +# initialize variables +courtYRng = () +courtXRng = () +racketXRng = () +racketYRng = () + +try: + if dconf['env']['name'] == 'Pong-v0' or dconf['env']['name'] == 'Pong-v4': + isVertical = False # only one can be true + isHorizontal = True + courtYRng = (34, 194) # court y range + courtXRng = (20, 140) # court x range + racketXRng = (141, 144) # racket x range + if dconf['env']['name'] == 'Breakout-v0' or dconf['env']['name'] == 'Breakout-v4': + isVertical = True + isHorizontal = False + # courtXRng = (9, 159) # visible x rng + overhang on right (cant see objects in overhang) + courtXRng = (9,149) # visible x rng + # courtYRng = (32, 189) # entire above racket + courtYRng = (93, 188) # just below bricks & above racket + racketYRng = (189,192) # racket +except: + print('Exception in ENVspecifics') + isVertical = False # only one can be true + isHorizontal = True + courtYRng = (34, 194) # court y range + courtXRng = (20, 140) # court x range + racketXRng = (141, 144) # racket x range + +# get smallest angle difference +def getangdiff (ang1, ang2): + if ang1 > 180.0: + ang1 -= 360.0 + if ang2 > 180.0: + ang2 -= 360.0 + angdiff = ang1 - ang2 + if angdiff > 180.0: + angdiff-=360.0 + elif angdiff < -180.0: + angdiff+=360.0 + return angdiff + +class AIGame: + """ Interface to OpenAI gym game + """ + def __init__ (self,fcfg='sim.json'): # initialize variables + if useSimulatedEnv: self.breakout = breakout + else: self.env = env + self.countAll = 0 + self.ldir = ['E','NE','N', 'NW','W','SW','S','SE'] + self.ldirpop = ['EV1D'+Dir for Dir in self.ldir] + self.lratepop = ['ER'] # populations that we calculate rates for + for d in self.ldir: self.lratepop.append('EV1D'+d) + self.dFVec = OrderedDict({pop:h.Vector() for pop in self.lratepop}) # NEURON Vectors for firing rate calculations + self.dFiringRates = OrderedDict({pop:np.zeros(dconf['net'][pop]) for pop in self.lratepop}) # python objects for firing rate calculations + self.dAngPeak = OrderedDict({'EV1DE': 0.0,'EV1DNE': 45.0, # receptive field peak angles for the direction selective populations + 'EV1DN': 90.0,'EV1DNW': 135.0, + 'EV1DW': 180.0,'EV1DSW': 235.0, + 'EV1DS': 270.0,'EV1DSE': 315.0}) + self.AngRFSigma2 = dconf['net']['AngRFSigma']**2 # angular receptive field (RF) sigma squared used for dir selective neuron RFs + if self.AngRFSigma2 <= 0.0: self.AngRFSigma2=1.0 + self.input_dim = int(np.sqrt(dconf['net']['ER'])) # input image XY plane width,height + self.dirSensitiveNeuronDim = int(np.sqrt(dconf['net']['EV1DE'])) # direction sensitive neuron XY plane width,height + self.dirSensitiveNeuronRate = (dconf['net']['DirMinRate'], dconf['net']['DirMaxRate']) # min, max firing rate (Hz) for dir sensitive neurons + self.intaction = int(dconf['actionsPerPlay']) # integrate this many actions together before returning reward information to model + # these are Breakout-specific coordinate ranges + self.courtYRng = courtYRng + self.courtXRng = courtXRng + self.racketYRng = racketYRng # Either racketXRng or racketYRng will be zero for pong/breakout + self.racketXRng = racketXRng + self.dObjPos = {'racket':[], 'ball':[]} + self.last_obs = [] # previous observation + self.last_ball_dir = 0 # last ball direction + self.FullImages = [] # full resolution images from game environment + self.ReducedImages = [] # low resolution images from game environment used as input to neuronal network model + self.ldflow = [] # list of dictionary of optical flow (motion) fields + if dconf['DirectionDetectionAlgo']['CentroidTracker']: + self.ct = CentroidTracker() + self.objects = OrderedDict() # objects detected in current frame + self.last_objects = OrderedDict() # objects detected in previous frame + + def updateInputRates (self, dsum_Images): + # update input rates to retinal neurons + #fr_Images = np.where(dsum_Images>1.0,100,dsum_Images) #Using this to check what number would work for firing rate + #fr_Images = np.where(dsum_Images<10.0,0,dsum_Images) + fr_Images = 40/(1+np.exp((np.multiply(-1,dsum_Images)+123)/25)) + fr_Images = np.subtract(fr_Images,np.min(fr_Images)) #baseline firing rate subtraction. Instead all excitatory neurons are firing at 5Hz. + #print(np.amax(fr_Images)) + self.dFiringRates['ER'] = np.reshape(fr_Images,400) #400 for 20*20 + + def computeMotionFields (self, UseFull=False): + # compute and store the motion fields and associated data + if UseFull: + limage = self.FullImages + else: + limage = self.ReducedImages + if len(limage) < 2: + flow = np.zeros(shape=(limage[-1].shape[0],limage[-1].shape[1],2)) + mag = np.zeros(shape=(limage[-1].shape[0],limage[-1].shape[1])) + ang = np.zeros(shape=(limage[-1].shape[0],limage[-1].shape[1])) + ang[mag == 0] = -100 + goodInds = np.zeros(shape=(limage[-1].shape[0],limage[-1].shape[1])) + self.ldflow.append({'flow':flow,'mag':mag,'ang':ang,'goodInds':goodInds,'thang':ang,'thflow':flow}) + #return + else: + self.ldflow.append(getoptflow(limage[-2],limage[-1])) + + def computeAllObjectsMotionDirections(self, UseFull=False): + #Detect the objects, and initialize the list of bounding box rectangles + if len(self.FullImages)==0: return + if UseFull: + cimage = self.FullImages[-1] + else: + cimage = self.ReducedImages[-1] + rects = getObjectsBoundingBoxes(cimage) + cimage = np.ascontiguousarray(cimage, dtype=np.uint8) + # update our centroid tracker using the computed set of bounding box rectangles + self.objects = self.ct.update(rects) + if len(self.last_objects)==0: + self.last_objects = deepcopy(self.objects) + flow = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim,2)) + mag = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim)) + ang = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim)) + ang[mag == 0] = -100 + goodInds = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim)) + else: + dirX, dirY = getObjectMotionDirection(self.objects, self.last_objects, rects, dims=np.shape(cimage)[0],\ + FlowWidth=dconf['DirectionDetectionAlgo']['FlowWidth']) + if np.shape(cimage)[0] != self.dirSensitiveNeuronDim or np.shape(cimage)[1] != self.dirSensitiveNeuronDim: + dirX = resize(dirX, (self.dirSensitiveNeuronDim, self.dirSensitiveNeuronDim), anti_aliasing=True) + dirY = resize(dirY, (self.dirSensitiveNeuronDim, self.dirSensitiveNeuronDim), anti_aliasing=True) + mag, ang = cv2.cartToPolar(dirX, -1*dirY) + ang = np.rad2deg(ang) + ang[mag == 0] = -100 + self.last_objects = deepcopy(self.objects) + flow = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim,2)) + flow[:,:,0] = dirX + flow[:,:,1] = dirY + goodInds = np.zeros(shape=(self.dirSensitiveNeuronDim,self.dirSensitiveNeuronDim)) + self.ldflow.append({'flow':flow,'mag':mag,'ang':ang,'goodInds':goodInds,'thang':ang,'thflow':flow}) + + def updateDirSensitiveRates (self): + # update firing rate of dir sensitive neurons using dirs (2D array with motion direction at each coordinate) + if len(self.ldflow) < 1: return + dflow = self.ldflow[-1] + motiondir = dflow['thang'] # angles in degrees, but thresholded for significant motion; negative value means not used + dAngPeak = self.dAngPeak + dirSensitiveNeuronDim = self.dirSensitiveNeuronDim + if motiondir.shape[0] != dirSensitiveNeuronDim or motiondir.shape[1] != dirSensitiveNeuronDim: + motiondir = resize(motiondir, (dirSensitiveNeuronDim, dirSensitiveNeuronDim), anti_aliasing=True) + AngRFSigma2 = self.AngRFSigma2 + MaxRate = self.dirSensitiveNeuronRate[1] + for pop in self.ldirpop: self.dFiringRates[pop] = self.dirSensitiveNeuronRate[0] * np.ones(shape=(dirSensitiveNeuronDim,dirSensitiveNeuronDim)) + for y in range(motiondir.shape[0]): + for x in range(motiondir.shape[1]): + if motiondir[y,x] >= 0.0: # make sure it's a valid angle + for pop in self.ldirpop: + fctr = np.exp(-1.0*(getangdiff(motiondir[y][x],dAngPeak[pop])**2)/AngRFSigma2) + #print('updateDirRates',pop,x,y,fctr,dAngPeak[pop],motiondir[y][x]) + self.dFiringRates[pop][y,x] += MaxRate * fctr + #print('motiondir',motiondir) + for pop in self.ldirpop: + self.dFiringRates[pop]=np.reshape(self.dFiringRates[pop],dirSensitiveNeuronDim**2) + #print(pop,np.amin(self.dFiringRates[pop]),np.amax(self.dFiringRates[pop]),np.mean(self.dFiringRates[pop])) + #print(pop,self.dFiringRates[pop]) + + def findobj (self, img, xrng, yrng): + # find an object's x, y position in the image (assumes bright object on dark background) + subimg = img[yrng[0]:yrng[1],xrng[0]:xrng[1],:] + sIC = np.sum(subimg,2) #assuming the color of object is uniform, add values or r,g,b to get a single value + pixelVal = np.amax(sIC) #find the pixel value representing object assuming a black background + sIC[sIC0: + Obj_inds.append([i,j]) + if sIC.shape[0]*sIC.shape[1]==np.shape(Obj_inds)[0]: #if there is no object in the subimage + ypos = -1 + xpos = -1 + else: + ypos = np.median(Obj_inds,0)[0] #y position of the center of mass of the object + xpos = np.median(Obj_inds,0)[1] #x position of the center of mass of the object + return xpos, ypos + + def predictBallRacketXIntercept(self, xpos1, ypos1, xpos2, ypos2): # Vertical games like breakout + courtYRng, courtXRng = self.courtYRng, self.courtXRng # coordinate ranges for different objects + courtHeight = courtYRng[1] - courtYRng[0] + courtWidth = courtXRng[1] - courtXRng[0] + if ((ypos1==-1) or (ypos2==-1)): + predX = -1 + else: + deltay = ypos2-ypos1 + if deltay<=0: + predX = -1 + else: + if xpos1<0: + predX = -1 + else: + NB_intercept_steps = np.ceil((CourtHeight - ypos2)/deltay) + deltax = xpos2-xpos1 + predX_nodeflection = xpos2 + (NB_intercept_steps*deltax) + if predX_nodeflection<0: + predX = -1*predX_nodeflection + elif predX_nodeflection>courtWidth: + predX = predX_nodeflection-courtWidth + else: + predX = predX_nodeflection + return predX + + def predictBallRacketYIntercept(self, xpos1, ypos1, xpos2, ypos2): # Horizontal games like pong + courtYRng, courtXRng = self.courtYRng, self.courtXRng # coordinate ranges for different objects + courtHeight = courtYRng[1] - courtYRng[0] + courtWidth = courtXRng[1] - courtXRng[0] + if ((xpos1==-1) or (xpos2==-1)): + predY = -1 + else: + deltax = xpos2-xpos1 + if deltax<=0: + predY = -1 + else: + if ypos1<0: + predY = -1 + else: + NB_intercept_steps = np.ceil((CourtHeight - xpos2)/deltax) + deltay = ypos2-ypos1 + predY_nodeflection = ypos2 + (NB_intercept_steps*deltay) + if predY_nodeflection<0: + predY = -1*predY_nodeflection + elif predY_nodeflection>courtWidth: + predY = predY_nodeflection-courtWidth + else: + predY = predY_nodeflection + return predY + + def playGame (self, actions, epCount): #actions need to be generated from motor cortex + # PLAY GAME + rewards = []; proposed_actions =[]; total_hits = []; Images = [] + input_dim = self.input_dim + done = False + courtYRng, courtXRng, racketYRng, racketXRng = self.courtYRng, self.courtXRng, self.racketYRng, self.racketXRng # coordinate ranges for different objects (Breakout-specific) + if self.intaction==1: + lgwght = [1.0] + else: + lgwght = np.linspace(0.6, 1, self.intaction) # time-decay grayscale image weights (earlier indices with lower weights are from older frames) + lgimage = [] # grayscale down-sampled images with decaying time-lagged input + lgimage_ns = [] #grayscale full images with decaying time-lagged input + if len(self.last_obs)==0: #if its the first action of the episode, there won't be any last_obs, therefore no last image + lobs_gimage_ds = [] + else: + lobs_gimage = 255.0*rgb2gray(self.last_obs[courtYRng[0]:courtYRng[1],:,:]) + lobs_gimage_ds = downscale_local_mean(lobs_gimage,(8,8)) + lobs_gimage_ds = np.where(lobs_gimage_ds>np.min(lobs_gimage_ds)+1,255,lobs_gimage_ds) + lobs_gimage_ds = 0.5*lobs_gimage_ds #use this image for motion computation only + + for adx in range(self.intaction): + #for each action generated by the firing rate of the motor cortex, find the suggested-action by comparing the position of the ball and racket + caction = actions[adx] #action generated by the firing rate of the motor cortex + + if np.shape(self.last_obs)[0]>0: #if last_obs is not empty + xpos_Ball, ypos_Ball = self.findobj(self.last_obs, courtXRng, courtYRng) # get x,y positions of ball + if isVertical: + xpos_Racket, ypos_Racket = self.findobj(self.last_obs, courtXRng, racketYRng) # get x,y positions of racket + #Now we know the position of racket relative to the ball. We can suggest the action for the racket so that it doesn't miss the ball. + #For the time being, I am implementing a simple rule i.e. based on only the ypos of racket relative to the ball + if ypos_Ball==-1: #guess about proposed move can't be made because ball was not visible in the court + proposed_action = -1 #no valid action guessed + elif xpos_Racket>xpos_Ball: #if the racket is right to the ball the suggestion is to move left + proposed_action = dconf['moves']['LEFT'] #move left + elif xpos_Racketypos_Ball: #if the racket is lower than the ball the suggestion is to move up + proposed_action = dconf['moves']['UP'] #move up + elif ypos_Racket0 and ypos_Ball2>0: + if ypos_Ball2 - ypos_Ball>0: + ball_moves_towards_racket = True # use proposed action for reward only when the ball moves towards the racket + current_ball_dir = 1 + elif ypos_Ball2 - ypos_Ball<0: + ball_moves_towards_racket = False + current_ball_dir = -1 + else: + ball_moves_towards_racket = False + current_ball_dir = 0 #direction can't be determinted prob. because the ball didn't move in x dir. + else: + ball_moves_towards_racket = False + current_ball_dir = 0 #direction can't be determined because either current or last position of the ball is outside the court + if isHorizontal: + if xpos_Ball>0 and xpos_Ball2>0: + if xpos_Ball2-xpos_Ball>0: + ball_moves_towards_racket = True # use proposed action for reward only when the ball moves towards the racket + current_ball_dir = 1 + elif xpos_Ball2-xpos_Ball<0: + ball_moves_towards_racket = False + current_ball_dir = -1 + else: + ball_moves_towards_racket = False + current_ball_dir = 0 #direction can't be determinted prob. because the ball didn't move in x dir. + else: + ball_moves_towards_racket = False + current_ball_dir = 0 #direction can't be determined because either current or last position of the ball is outside the court + + skipPred = False # skip prediction of x intercept? + if "followOnlyTowards" in dconf: + if dconf["followOnlyTowards"] and not ball_moves_towards_racket: + proposed_action = -1 # no proposed action if ball moving away from racket + skipPred = True # skip prediction if ba + + if not skipPred and "useRacketPredictedPos" in dconf: + if dconf["useRacketPredictedPos"]: + xpos_Racket2, ypos_Racket2 = self.findobj (observation, courtXRng, racketYRng) + if isVertical: + predX = self.predictBallRacketXIntercept(xpos_Ball,ypos_Ball,xpos_Ball2,ypos_Ball2) + if predX==-1: + proposed_action = dconf['moves']['NOMOVE'] #for breakout, need caction=1 to respawn ball + else: + targetX = xpos_Racket2 - predX # 8 is half the racket length (16 pixels total) + if targetX>8: # racket is to right of predX + proposed_action = dconf['moves']['LEFT'] #move left + elif targetX<-8: # racket is to left of predX + proposed_action = dconf['moves']['RIGHT'] #move right + else: + proposed_action = dconf['moves']['NOMOVE'] #no move + if isHorizontal: + predY = self.predictBallRacketYIntercept(xpos_Ball,ypos_Ball,xpos_Ball2,ypos_Ball2) + if predY==-1: + proposed_action = -1 + else: + targetY = ypos_Racket2 - predY + if targetY>8: + proposed_action = dconf['moves']['UP'] #move up + elif targetY<-8: + proposed_action = dconf['moves']['DOWN'] #move down + else: + proposed_action = dconf['moves']['NOMOVE'] #no move + + ball_hits_racket = 0 + # previously I assumed when current_ball_dir is 0 there is no way to find out if the ball hit the racket + if isVertical: + if current_ball_dir-self.last_ball_dir<0 and reward==0 and ypos_Ball2>courtYRng[1]-courtYRng[0]-20: #Last 20 pixels of court + ball_hits_racket = 1 + if isHorizontal: + if current_ball_dir-self.last_ball_dir<0 and reward==0 and xpos_Ball2>courtXRng[1]-courtXRng[0]-40: + ball_hits_racket = 1 + #print('Current_ball_dir', current_ball_dir) + #print('Last ball dir', self.last_ball_dir) + #print('current X pos Ball', xpos_Ball2) + #print('last X pos Ball', xpos_Ball) + #print('Court Range',courtXRng) + print(ball_hits_racket) + self.last_ball_dir = current_ball_dir + total_hits.append(ball_hits_racket) # i dont think this can be more than a single hit in 5 moves. so check if sum is greater than 1, print error + if not useSimulatedEnv: + self.env.render() + self.last_obs = observation # current observation will be used as last_obs for the next action + if done: + if not useSimulatedEnv: self.env.reset() + self.last_obs = [] # when the game ends, and new game starts, there is no last observation + self.last_ball_dir=0 + done = False + rewards.append(reward) + proposed_actions.append(proposed_action) + gray_Image = 255.0*rgb2gray(observation[courtYRng[0]:courtYRng[1],:,:]) # convert to grayscale; rgb2gray has 0-1 range so mul by 255 + gray_ds = downscale_local_mean(gray_Image,(8,8)) # then downsample + gray_ds = np.where(gray_ds>np.min(gray_ds)+1,255,gray_ds) # Different thresholding + gray_ns = np.where(gray_Image>np.min(gray_Image)+1,255,gray_Image) + lgimage_ns.append(lgwght[adx]*gray_ns) + lgimage.append(lgwght[adx]*gray_ds) # save weighted grayscale image from current frame + self.countAll += 1 + + # NB: previously we merged 2x2 pixels into 1 value. Now we merge 8x8 pixels into 1 value. + # so the original 160x160 pixels will result into 20x20 values instead of previously used 80x80. + if len(lgimage)>1: + dsum_Images = np.maximum(lgimage[0],lgimage[1]) + nsum_Images = np.maximum(lgimage_ns[0],lgimage_ns[1]) + for gimage in lgimage[2:]: dsum_Images = np.maximum(dsum_Images,gimage) + for gimage in lgimage_ns[2:]: nsum_Images = np.maximum(nsum_Images,gimage) + else: + dsum_Images = lgimage[0] + nsum_Images = lgimage_ns[0] + self.FullImages.append(nsum_Images) # save full images ----> THIS IS JUST USED FOR DIRECTIONS (for accuracy) + self.ReducedImages.append(dsum_Images) # save the input image + + self.updateInputRates(dsum_Images) # update input rates to retinal neurons + if self.intaction==1: #if only one frame used per play, then add the downsampled and scaled image from last_obs for direction computation + if len(lobs_gimage_ds)>0: + dsum_Images = np.maximum(dsum_Images,lobs_gimage_ds) + if dconf['DirectionDetectionAlgo']['OpticFlow']: + self.computeMotionFields(UseFull=dconf['DirectionDetectionAlgo']['UseFull']) # compute the motion fields + elif dconf['DirectionDetectionAlgo']['CentroidTracker']: + self.computeAllObjectsMotionDirections(UseFull=dconf['DirectionDetectionAlgo']['UseFull']) # compute the motion field using CetroidTracking + self.updateDirSensitiveRates() # update motion sensitive neuron input rates + + if done: # done means that 1 episode of the game finished, so the environment needs to be reset. + epCount.append(self.countAll) + if not useSimulatedEnv: + self.env.reset() + #self.env.frameskip = 3 # why is frameskip set to 3?? + self.countAll = 0 + if np.sum(total_hits)>1: + print('ERROR COMPUTING NUMBER OF HITS') + for r in range(len(rewards)): + if rewards[r]==-1: total_hits[r]=-1 #when the ball misses the racket, the reward is -1 + return rewards, epCount, proposed_actions, total_hits + diff --git a/dad_notes.txt b/dad_notes.txt index fa5d536f..660e32f9 100644 --- a/dad_notes.txt +++ b/dad_notes.txt @@ -1,4 +1,299 @@ ######################################## +8-18-20 +######################################## +To-Do: +-Submit abstract by 9/1 + # waiting on friend +-Troubleshoot aigame3.py + * Added fixed prediction code + * No errors when compiling +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 +-Make aigame3.py more modular + +Fixed getangdiff error in aigame3.py +The try statement above it for env settings needed an except statement + +Added fixed racket prediction code + Only in aigame3.py not aigame2.py!! +# simple fix, needed to respawn ball + if predX==-1: + caction = 1 +######################################## +8-17-20 +######################################## +To-Do: +-Submit abstract by 9/1 + # waiting on sam notes +-Troubleshoot aigame3.py + -Add fixed racket predictions code +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +$ python aigame3.py + + + File "aigame3.py", line 84 + def getangdiff (ang1, ang2): + ^ +SyntaxError: invalid syntax + +#not sure why, same code as aigame.py and that runs + +Finished abstract +# friend to look at it before submitting +######################################## +8-12-20 +######################################## +To-Do: +-Finish Abstract on work I've done + # Second draft, then sam will look at it. +-Combine aigame.py & aigame2.py + * Progess + # next to troubleshoot + * next week + # Upload fixed racket prediction code +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +Out tomorrow, day off for moving. +######################################## +8-11-20 +######################################## +To-Do: +-Test prediction for longer, see when ball goes above bricks + -needs ball to spawn back first + *Done + -When it misses, is it after close deflection or cuz of speed? + # need to observe over time +# has been good to hit after deflection +# mainly misses when paddle is too far left and doesn't move to right +# majority of the time, when the racket misses, the ball is on the right (9/10 times) + +score after done: +23 +72 +20 +48 +43 +18 +29 + +further back rows are worth more points +* print reward to see if diff bricks give different reward +>>> import gym +>>> env = gym.make ('Breakout-v0', frameskip=3) +>>> env.reset() +>>> obs, reward, done, info = env.step(1); env.render(); print(reward) +color - reward - point +blue - 1.0 - 1 +green - 1.0 - 1 +yellow - 4.0 - 4 +orange 1 - 4.0 - 4 +orange 2 - +red - +# after hits a brick, ball ghosts through other bricks until it hits racket +######################################## +8-10-20 +######################################## +To-Do: +-Finish Abstract on work I've done + # plotRecurrentMaps, momentum (aigame1), breakout(aigame2, testRacketPrediction) +-Test prediction for longer, see when ball goes above bricks + -needs ball to spawn back first + *Done + -When it misses, is it after close deflection or cuz of speed? + # need to observe over time +-Combine aigame.py & aigame2.py + * Progess + # next to troubleshoot + # want to fix testRacketPredictions before moving forward +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +stayStepLim will need to be changed accordingly +# from memory, not 100% sure +for pong: 6 +for breakout: 4 + +# how each game is defined, only works for 1 dimension games + if dconf['env']['name'] == 'Pong-v0' or dconf['env']['name'] == 'Pong-v4': + isVertical = False + isHorizontal = True + courtYRng = (34, 194) # court y range + courtXRng = (20, 140) # court x range + racketXRng = (141, 144) # racket x range + if dconf['env']['name'] == 'Breakout-v0' or dconf['env']['name'] == 'Breakout-v4': + isVertical = True + isHorizontal = False + # courtXRng = (9, 159) # visible x rng + overhang on rig +ht (cant see objects in overhang) + courtXRng = (9,149) # visible x rng + # courtYRng = (32, 189) # entire above racket + courtYRng = (93, 188) # just below bricks & above racket + racketYRng = (189,192) # racket + + +playGame differences + aigame1 : aigame3 + 88-90 : 101-103 # court size * done + 262-272 : 298-308 # proposed action * done + 282 : 318 # momentum loop conditions (actions) * done + 293-297 : 329-333 # ball_moves_towards_racket * done + 316-326 : 352-362 # proposed action * done + 330 : 366 # ball_hits_racket conditions * donen + +RacketXRng vs RacketYRng +Breakout uses YRng, pong uses XRng +used at findObj function + +testRacketPredictions +according to stackOverflow, at end of life you need to fire (action 1) to respawn ball +!!!!! * if predX = -1, caction = 1 +ran for 20,000 +it works for most part, misses sometimes + +######################################## +8-9-20 +######################################## +looked through aigame3 + +fixes for differences in code: +#variable ideas +isHorizontal (boolean) +isVertical (boolean) + +courtSize? +if statement based on dcont['env'] == 'breakout' or 'pong' + also set for momentum loop +proposed action will need seperate loops (different playgame functions + +class AIGame +multiple playGame functions + +playGameBreakout +playGamePong +playGame + +if dconf['env'] == 'breakout' + playGame = playGameBreakout +if dconf['env'] == 'pong' + playGame = playGamePong + +######################################## +8-7-20 +######################################## +having trouble open files. +Uploaded notes to github + faced problems, looking into it... +finished locating differences to merge aigame1 & aigame2 (pong & breakout) + now just need to create logic to merge + +######################################## +8-6-20 +######################################## +Did first draft of abstract, sent to sam + +playGame differences + aigame1 : aigame3 + 88-90 : 101-103 # court size + 262-272 : 298-308 # proposed action + 282 : 318 # momentum loop conditions (actions) + 293-297 : 329-333 # ball_moves_towards_racket + 316-326 : 352-362 # proposed action + 330 : 366 # ball_hits_racket conditions +######################################## +8-5-20 +######################################## +-Finish Abstract on work I've done + # plotRecurrentMaps, momentum (aigame1), breakout(aigame2, testRacketPrediction) +-Test prediction for longer, see when ball goes above bricks + -First need ball to spawnback after it is lost + *Paused +-Combine aigame.py & aigame2.py + * Started +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +Needs fix in aigame3.py: + simulated env 47-50, 81 + default env 59-62 + court size 101-103 + x vs y intercept + +Notes: + updated predictBallRacketYIntercept from my predictBallRacketXIntercept + removed hard-coded numbers +Questions: + hard-coded # in updateInputRates (same in both) + +All left is playGame. I also told lakshay to look at this function + court dimensions (88-90 aigame, 94-96 aigame2) + 262-272, 292-306 aigame , 266-276, 296-310 aigame2 +######################################## +8-4-20 +######################################## +-Test prediction for longer, see when ball goes above bricks + -First need ball to spawnback after it is lost + *Paused +-Combine aigame.py & aigame2.py + * Started +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +invisible screensaver locked me out. Turned it off. +Taking break on testRacketPredictions to rethink later + +Started combining scripts (aigame3.py = aigame.py + aigame2.py) +* Lakshay joined to help + * Told him to look at playGame function +Needs logic: +-simulated environment + +Ideas: +-Break playGame into more functions and flesh it out into basic functions to be called based on dconf['env'] + vertical vs horizontal to decide intercept + momentum loop is a function +######################################## +8-3-20 +######################################## +-Test prediction for longer, see when ball goes above bricks + -First need ball to spawnback after it is lost + *Started +-Update staymoves (momentum) loop + * Working with Lakshay (never happened) + * DONE, now dependent on stayStepLim (sim.json) + * moves: LEFT, RIGHT, NOMOVE +-Combine aigame.py & aigame2.py + * this week (?) +-sim.py motor populations w/ help + -Haroon says to add to aigame.py which moves to use? +-Update computer vision for racket predictions + -Currently limited coordinated to not include bricks for simplicity in object detections + -Check notes on 7/27 + +Talked to s&h about ball not coming back in test +After this, only some big projects left +Broke down and commented through testRacketrPredictions to help fix bug +######################################## 7-31-20 ######################################## To-Do: @@ -7,8 +302,11 @@ To-Do: # env = gym.make('Breakout-v0', frameskip=3) * Updated time to 200,000. Ball still does not come back after first miss. -Upload notes to github + * Done -Update staymoves (momentum) loop + * Working with Lakshay -Combine aigame.py & aigame2.py + * next week. -sim.py motor populations w/ help -Haroon says to add to aigame.py which moves to use? -Update computer vision for racket predictions @@ -21,6 +319,12 @@ Tutorial for pull request 3. git push 4. Go to github site to submit pull request +ran testRacketPredictions2.py for 200,000 +Ball disappears after first miss and never spawns back. +ran manual control over same env (breakoutv0, fk=3) +Ball always reappears after some seconds +Not sure what is preventing the ball to come back + will research into others with similar case ######################################## 7-30-20 ######################################## diff --git a/hanotes.org b/hanotes.org index e829293a..a231247e 100644 --- a/hanotes.org +++ b/hanotes.org @@ -11688,3 +11688,4006 @@ EA to EM: 7.5 (was 8 before, after that 5: 5 gave too low firing rate) python multistepSim.py sim.json 32 5 20dec23_D0_cycle_multi + +-- looking at raster of 20dec22_A0_full_falcor.... +EA(1.42Hz)->IA(43.48Hz)....too strong. +EA(1.42Hz)->EA2(14.92Hz).... too strong. +exct drive to EM neurons high too..... +take a snapshot of raster... saved on my desktop + +-- run 5 sec sim in "20dec23_A0_full_falcor" +EA(3.81Hz)->IA(32.04Hz):10 (10 in 20dec22_A0_full_falcor) +EA(3.81Hz)->EA2(14.86Hz): 3.75(3.75 in 20dec22_A0_full_falcor) +EA2(14.86Hz)->IA2(39.29Hz):10 (10 in 20dec22_A0_full_falcor) +raster between 1000 and 1400 ms saved on Desktop as "20dec23_A0_full_falcor_raster1" +raster between 1100 and 1140 ms (ylim:(9000,15000))saved on Desktop as "20dec23_A0_full_falcor_raster2" + +-- run 5 sec sim in "20dec23_A1_full_falcor" +EA(6.41Hz)->IA(41.45Hz):5 (10 in 20dec22_A0_full_falcor) +EA(6.41Hz)->EA2(18.33Hz): 2.0(3.75 in 20dec22_A0_full_falcor) +EA2(18.33Hz)->IA2(46.4Hz):5 (10 in 20dec22_A0_full_falcor) +raster between 1000 and 1400 ms saved on Desktop as "20dec23_A1_full_falcor_raster1" +raster between 1150 and 1175 ms saved on Desktop as "20dec23_A1_full_falcor_raster2" + +-- run 5 sec sim in "20dec23_A2_full_falcor" +EA(6.14 Hz)->IA(27.24 Hz):2.5 +EA(6.14 Hz)->EA2(6.7 Hz): 1.0 +EA2(6.7 Hz)->IA2(15.36 Hz):2.5 +raster between 1000 and 1400 ms saved on Desktop as "20dec23_A2_full_falcor_raster1" +and "20dec23_A2_full_falcor_raster2" + +-- run 5 sec sim in "20dec23_A3_full_falcor" +EA( 3.68 Hz)->IA( 13.35 Hz):1.5 +EA( 3.68 Hz)->EA2( 9.88 Hz): 2.0 ...should reduce +EA2(9.88 Hz)->IA2(21.73 Hz):1.5 +VL -> EA: 2.5 (was 5 before) +several rasters saved as +"20dec23_A3_full_falcor_raster1" +"20dec23_A3_full_falcor_raster2" +"20dec23_A3_full_falcor_raster3" +"20dec23_A3_full_falcor_raster4" + +-- run 5 sec sim in "20dec23_A4_full_falcor" +EA->IA:1.5 +EA->EA2: 2.0 ...should reduce +EA2->IA2:1.5 +VL -> EA: 5 +VD -> EA: 2.5 +didnt save plots because not enough inputs to drive EA. + +-- run 5 sec sim in "20dec24_A0_full_falcor" +EA(9.94 Hz)->IA(63.89 Hz):1.5 +EA(9.94 Hz)->EA2(28.7Hz): 2.0 ...should reduce +EA2(28.7Hz)->IA2(73.55Hz):1.5 +VL(0.3Hz) -> EA: 10 +VD (1.68Hz - 4.55 Hz)-> EA: 2.5 + +-- run 5 sec sim in "20dec24_A1_full_falcor" +EA(4.87Hz)->IA(15.76Hz):1.5 +EA()->EA2(28.7Hz): 2.0 ...should reduce +EA2(10.71Hz)->IA2(25.3Hz):1.5 +VL(0.5 Hz) -> EA: 7 +VD (0.2Hz - 3.12 Hz)-> EA: 2.5 .... the range is low because less movements. + + +may be turn off VD to see what level of conductance is required to activate EA just by VL + + +--run 5 sec sim in "20dec24_A2_full_falcor" + +EA->IA:1.5 +EA->EA2: 2.0 ...should reduce +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 + + +--run 5 sec sim in "20dec24_A2_full_falcor"...over writing + +EA->IA:1.5 +EA->EA2: 2.0 ...should reduce +EA2->IA2:1.5 +VL -> EA: 7 +VD -> EA: 0 + + +--run 5 sec sim in "20dec24_A3_full_falcor" + +EA->IA:1.5 +EA->EA2: 2.0 ...should reduce +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 +saved rasters as: +20dec24_A3_full_falcor_raster1.png +20dec24_A3_full_falcor_raster2.png + +This (VL->EA:8) seems to be a good number to pass information to EA without interuption. +firing rate of EA: 4.68Hz is not bad. but try to reduce it by playing with stimModVD. + +--run 5 sec sim in "20dec24_A4_full_falcor" +EA->IA:1.5 +EA->EA2: 1.75 +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 +stimModVL: 35 (was 35 before) +EA->EM:2 +EA2->EM:2 + +--run 5 sec sim in "20dec24_A5_full_falcor" +EA->IA:1.5 +EA->EA2: 1.75 +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 +stimModVL: 35 (was 35 before) +EA->EM:2 +EA2->EM:2 +add noise: g of 1 + +... not much different than before. + +--run 5 sec sim in "20dec24_A6_full_falcor" +EA->IA:1.5 +EA->EA2: 1.75 +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 +stimModVL: 35 (was 35 before) +EA->EM:2 +EA2->EM:2 +add noise: g of 2.5 + + +--run 5 sec sim in "20dec24_A7_full_falcor" +EA->IA:1.5 +EA->EA2: 1.75 +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 0 +stimModVL: 35 (was 35 before) +EA->EM:2 +EA2->EM:2 +add noise: g of 5 + + + +--run 5 sec sim in "20dec24_A8_full_falcor" +EA->IA:1.5 +EA->EA2: 1.75 +EA2->IA2:1.5 +VL -> EA: 8 +VD -> EA: 2.5 +stimModVL: 35 (was 35 before) +EA->EM:2 +EA2->EM:2 +add noise: g of 5 + +--run 500 sec sim in "20dec24_A8long_full_falcor" +Hitt/Miss ration ~0.41 and rising. + +--run 500 sec sim in "20dec25_A8long_fullRL1_falcor" +Hitt/Miss ration dropped to ~0.2 +P(follow) also dropped to 0.26 + +--run 500 sec sim in "20dec27_A8long_fullRL1_falcor" +with "RLhebbwt": 0.002, +Hitt/Miss ration flat at ~0.36 + +-- for reduced model + +-- targettedRL:3 +cp backupcfg/20dec21_B0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json +nano sim.json +"name": "20dec24_B0_cycle_reduced_2obj_INTF7__step_0_", +EA to EM conn: 7.5 (5 didnt work) +RLhebbwt = 0.1 +RLlenhebb = 100 +tauhebb = 10 +no noise. + python multistepSim.py sim.json 20 5 20dec24_B0_cycle_multi + +cycle rebooted.... sims terminated. + +"name": "20dec27_B0_cycle_reduced_2obj_INTF7_" +python multistepSim.py sim.json 20 5 20dec27_B0_cycle_multi + +-- targettedRL = 1 +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/20dec24_D0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ nano sim.json +"name": "20dec24_D0_cycle_reduced_2obj_INTF7__step_0_" +EA to EM conn: 7.5 +RLhebbwt = 0.2 +RLlenhebb = 100 +tauhebb = 10 +no noise. + + python multistepSim.py sim.json 20 5 20dec24_D0_cycle_multi + +cycle rebooted.... sims terminated. + +"name": "20dec27_D0_cycle_reduced_2obj_INTF7_" +python multistepSim.py sim.json 20 5 20dec27_D0_cycle_multi + + + -- targettedRL = 0 +nano sim.json + "name": "20dec24_A0_cycle_reduced_2obj_INTF7__step_0_", +"targettedRL": 0, +EA to EM conn: 7.5 +RLhebbwt = 0.1 +RLlenhebb = 100 +tauhebb = 10 +no noise. + +python multistepSim.py sim.json 20 5 20dec24_A0_cycle_multi + +cycle rebooted.... sims terminated. + +"name": "20dec27_A0_cycle_reduced_2obj_INTF7_" +python multistepSim.py sim.json 20 5 20dec27_A0_cycle_multi + +* 20dec28 + +-- resume simFull on falcor with RL = 0 and named "20dec28_A8long_full_falcor_" +... resumed from 20dec24_A8long_full_falcor_.. +... this is still the previous model... Sam has a new model with more types of synapses. + +-- adapting sim.json and simFull.json for new model...... + + +cp simFull.json simFull_backup.json +cp sim.json sim_backup.json + +-- create a new file simReduced.py to be used with simReduced.json..... this is for reduced model. +... this doesnt seem to be an easy fix. looks more confusing..... + +-- i will keep working with sim.py. +-- and 2 model parameter files. simFull.json (for full model) and simReduced.json (for reduced model). + +* 20dec29 + +-- sam found a couple of bugs in the new model and he fixed last night. + +-- i will start again modifying my scripts with goals: +1. Should be able to run sim.py using simReduced.json where simReduced.json should reproduce results as with model before dec 25. +2. Should be able to run sim.py using simFull.py where simFull.py is based on sn.json on dec29. +3. shoule be able to extend reduced model in sim.json. + +-- sim.json -- still same file as i used to run reducedModel on cycle. + +-- updated simFull.json based on (exactly same as) sn.json. + +-- copied sn.json into simReduced.json and started modifying for reduced model. +set w for all noise to 0. +copied RL params from sim.json to simReduced.json +copied STDP params from sim.json to simReduced.json + for AMPAI remained same as in sn.json. + +unclear: +before i was using + + "delayMin": 2, + "delayMax": 5, + +and now sam is using + + "delayMinSoma": 1.8, + "delayMaxSoma": 2.2, + "delayMinDend": 3, + "delayMaxDend": 5 + +WHAT DOES THIS MEAN? + +Adjust INTF7E as + + dparam = {"ahpwt":1, + "tauahp":400, + "RMP": -65, + "VTH": -40, + "refrac": 5, + "Vblock": -25, + "tauAM": 5.5, + "tauNM": 166, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 166, + "tauRR": 1, + "RRWght": 0.25} + + + +Adjust INTF7I as + + dparam = {"ahpwt":0.5, + "tauahp":50, + "RMP": -63, + "VTH": -40, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 5.5, + "tauNM": 166, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 166, + "tauRR": 1, + "RRWght": 0.25} + + +updated cmat: +before was using AM and now AM2... so WHAT IS THE DIFFERENCE BETWEEN AM AND AM2? +only active syns are +VL -> EA {"AM2": 12,"NM2": 0.36, "conv": 0} +VD -> EA {"AM2": 12,"NM2": 0.36, "conv": 0} +EA -> EM {"AM2": 7.5,"NM2": 0.001, "p": 0.2} +EM -> IM {"AM2": 10,"NM2":0,"p": 0.125} +IM - > EM {"GA": 5.0, "p":0.25} + + + +-- analyzing reduced model using sim.json and old model. + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/20dec27_B0_cycle_reduced_2obj_INTF7__step_0_sim.json +reading backupcfg/20dec27_B0_cycle_reduced_2obj_INTF7__step_0_sim.json +-1 +lpop: ['EV1', 'EV1DE', 'EV1DNE', 'EV1DN', 'EV1DNW', 'EV1DW', 'EV1DSW', 'EV1DS', 'EV1DSE', 'EMDOWN', 'EMUP', 'IM'] +loading data from 20dec27_B0_cycle_reduced_2obj_INTF7__step_0_ +loading input images from data/20dec27_B0_cycle_reduced_2obj_INTF7__step_0_InputImages.txt +loaded simulation data 20dec27_B0_cycle_reduced_2obj_INTF7__step_0_ on 20dec29_ +EV1 10.32 Hz +EV1DE 2.84 Hz +EV1DNE 23.65 Hz +EV1DN 9.43 Hz +EV1DNW 11.14 Hz +EV1DW 0.96 Hz +EV1DSW 7.84 Hz +EV1DS 10.08 Hz +EV1DSE 25.45 Hz +EA 0.26 Hz +EMDOWN 3.75 Hz +EMUP 3.7 Hz +IM 24.07 Hz + +>>> lfn = ['20dec27_B0_cycle_reduced_2obj_INTF7__step_0_','20dec27_B0_cycle_reduced_2obj_INTF7__step_1_','20dec27_B0_cycle_reduced_2obj_INTF7__step_2_','20dec27_B0_cycle_reduced_2obj_INTF7__step_3_','20dec27_B0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) + +saved as 20dec29_20dec27_B0_reduced_RL3_Perf.png + + +lpda = getindivactionreward(lfn) + +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) + +saved as 20dec29_20dec27_B0_reduced_RL3_comparePerf.png + +resume 5 more steps.... + +cp backupcfg/20dec27_B0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json +nano sim.json + "simtype": { + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_B0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" + }, + +"name": "20dec30_B0_cycle_reduced_2obj_INTF7_", + + python multistepSim.py sim.json 20 5 20dec30_B0_cycle_multi +------------------------------------------------ + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/20dec27_D0_cycle_reduced_2obj_INTF7__step_0_sim.json +reading backupcfg/20dec27_D0_cycle_reduced_2obj_INTF7__step_0_sim.json +-1 +lpop: ['EV1', 'EV1DE', 'EV1DNE', 'EV1DN', 'EV1DNW', 'EV1DW', 'EV1DSW', 'EV1DS', 'EV1DSE', 'EMDOWN', 'EMUP', 'IM'] +loading data from 20dec27_D0_cycle_reduced_2obj_INTF7__step_0_ +loading input images from data/20dec27_D0_cycle_reduced_2obj_INTF7__step_0_InputImages.txt +loaded simulation data 20dec27_D0_cycle_reduced_2obj_INTF7__step_0_ on 20dec29_ +EV1 10.29 Hz +EV1DE 2.87 Hz +EV1DNE 25.73 Hz +EV1DN 7.28 Hz +EV1DNW 10.24 Hz +EV1DW 0.55 Hz +EV1DSW 5.7 Hz +EV1DS 8.82 Hz +EV1DSE 28.79 Hz +EA 0.25 Hz +EMDOWN 3.19 Hz +EMUP 3.16 Hz +IM 23.03 Hz + +>>> lfn = ['20dec27_D0_cycle_reduced_2obj_INTF7__step_0_','20dec27_D0_cycle_reduced_2obj_INTF7__step_1_','20dec27_D0_cycle_reduced_2obj_INTF7__step_2_','20dec27_D0_cycle_reduced_2obj_INTF7__step_3_','20dec27_D0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) + +saved as 20dec29_20dec27_D0_reduced_RL1_comparePerf.png + +>>> plotPerf(pdac) + +saved as 20dec29_20dec27_D0_reduced_RL1_Perf.png + +>>> pdfc = getconcatweightpdf(lfn) +>>> plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMDOWN','EMUP'],lclr=['r','b'],plotindiv=False) +saved as 20dec29_20dec27_D0_reduced_RL1_meanWeights.png + +resume 5 more steps.... + +cp backupcfg/20dec27_D0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json +nano sim.json + "simtype": { + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_D0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" + }, + + "name": "20dec30_D0_cycle_reduced_2obj_INTF7_", + + python multistepSim.py sim.json 20 5 20dec30_D0_cycle_multi + +--------------------------------------------------------------- +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/20dec27_A0_cycle_reduced_2obj_INTF7__step_0_sim.json +reading backupcfg/20dec27_A0_cycle_reduced_2obj_INTF7__step_0_sim.json +-1 +lpop: ['EV1', 'EV1DE', 'EV1DNE', 'EV1DN', 'EV1DNW', 'EV1DW', 'EV1DSW', 'EV1DS', 'EV1DSE', 'EMDOWN', 'EMUP', 'IM'] +loading data from 20dec27_A0_cycle_reduced_2obj_INTF7__step_0_ +loading input images from data/20dec27_A0_cycle_reduced_2obj_INTF7__step_0_InputImages.txt +loaded simulation data 20dec27_A0_cycle_reduced_2obj_INTF7__step_0_ on 20dec30_ +EV1 10.3 Hz +EV1DE 3.39 Hz +EV1DNE 26.43 Hz +EV1DN 6.82 Hz +EV1DNW 10.29 Hz +EV1DW 0.59 Hz +EV1DSW 5.16 Hz +EV1DS 7.58 Hz +EV1DSE 29.84 Hz +EA 0.25 Hz +EMDOWN 3.75 Hz +EMUP 3.73 Hz +IM 23.92 Hz + +>>> lfn = ['20dec27_A0_cycle_reduced_2obj_INTF7__step_0_','20dec27_A0_cycle_reduced_2obj_INTF7__step_1_','20dec27_A0_cycle_reduced_2obj_INTF7__step_2_','20dec27_A0_cycle_reduced_2obj_INTF7__step_3_','20dec27_A0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) + + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +saved as 20dec29_20dec27_A0_reduced_RL0_comparePerf.png + +>>> pdfc = getconcatweightpdf(lfn) +>>> plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMDOWN','EMUP'],lclr=['r','b'],plotindiv=False) +saved as 20dec29_20dec27_A0_reduced_RL0_meanWeights.png + +resume 5 more steps.... + +cp backupcfg/20dec27_A0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json +nano sim.json + + "simtype": { + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_A0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" + }, + + "name": "20dec30_A0_cycle_reduced_2obj_INTF7_", + + python multistepSim.py sim.json 20 5 20dec30_A0_cycle_multi + + --------------------------------- + + -- analyzing full model using simFull.json and old model. + + resumed from data/20dec24_A8long_full_falcor_synWeights_final.pkl + +could not save the output... segmentation fault. + +rerunning the sim. + + +----- + +cleaning disk space from cycle + +20dec07_A0_cycle_reduced_2obj_INTF7_Perf.png .... not good so remove data associated with it. +20dec08_A0_cycle_reduced_2obj_INTF7_Perf.png .... not good so remove data associated with it. +20dec09_A0_cycle_reduced_2obj_INTF7_Perf.png .... not good so remove data associated with it. + +20dec09_A1_falcor_reduced_2obj_INTF7_ looks good.... look at the perf plot. +20dec11_A0_cycle_reduced_2obj_INTF7_ 0 to 9 steps look good..... + + +remove data associated with 20dec16_A0_cycle_reduced_2obj_INTF7_ + + +--------- + +best to plot all and then remove if not good..... + +python -i simdat.py backupcfg/20dec09_A1_cycle_reduced_2obj_INTF7__step_0_sim.json + +rm data/20dec09_A1_cycle_reduced_2obj_INTF7__step_* + + +GOOD SIMS: + +"20dec11_A0_cycle_reduced_2obj_INTF7_comparePerf_step0to9.png" +"20dec11_A0_cycle_reduced_2obj_INTF7_Perf_step0to9.png" + +"20dec15_A0_cycle_reduced_2obj_INTF7_Perf_step0to4.png" +"20dec15_A0_cycle_reduced_2obj_INTF7_comparePerf_step0to4.png" + + +... finally i decided to delete *MotionFields.pkl + +-- did more steps increased the performance? + +sims were stopped while running STEP2 + +^C(base) hanwar@cycle:~/GamesProject/SMARTAgentls backupcfg/20dec30_* +backupcfg/20dec30_A0_cycle_reduced_2obj_INTF7__step_0_sim.json backupcfg/20dec30_B0_cycle_reduced_2obj_INTF7__step_1_sim.json +backupcfg/20dec30_A0_cycle_reduced_2obj_INTF7__step_1_sim.json backupcfg/20dec30_B0_cycle_reduced_2obj_INTF7__step_2_sim.json +backupcfg/20dec30_A0_cycle_reduced_2obj_INTF7__step_2_sim.json backupcfg/20dec30_D0_cycle_reduced_2obj_INTF7__step_0_sim.json +backupcfg/20dec30_A0_cycle_reduced_2obj_INTF7__step_3_sim.json backupcfg/20dec30_D0_cycle_reduced_2obj_INTF7__step_1_sim.json +backupcfg/20dec30_B0_cycle_reduced_2obj_INTF7__step_0_sim.json backupcfg/20dec30_D0_cycle_reduced_2obj_INTF7__step_2_sim.json + +only step0 and step1 are working...... + +do i need to run more? or should i do controls for now. + +>>> lfn = ['20dec27_D0_cycle_reduced_2obj_INTF7__step_0_','20dec27_D0_cycle_reduced_2obj_INTF7__step_1_','20dec27_D0_cycle_reduced_2obj_INTF7__step_2_','20dec27_D0_cycle_reduced_2obj_INTF7__step_3_','20dec27_D0_cycle_reduced_2obj_INTF7__step_4_','20dec30_D0_cycle_reduced_2obj_INTF7__step_0_'] +>>> pdac = getconcatactionreward(lfn) +>>> lpda = getindivactionreward(lfn) +>>> pdfc = getconcatweightpdf(lfn) + +it may go up if i keep running.... + + +... restarted multistep sims that were terminated over weekend. + +... also restarted sims on falcor + + +* 21jan4 + +cp sn.json simFull.json + +-- to understand the circuit, remove all the noise in simFull.json +-- set RL: AMPAI: RLon = 0 in simFull.json. +-- to understand the circuit, also make recurrent and feedback connection weights to 0. + + "cmat": { + "VL":{"EA":{"AM2": 0.3,"NM2": 0.1, "conv": 640}}, + "VD":{"EA":{"AM2": 0.6,"NM2": 0.1, "conv": 320}}, + "EA":{"EA2":{"AM2": 0.15,"NM2": 0.15, "conv": 250}, + "EM":{"AM2": 0.15,"NM2": 0.15, "conv": 250}}, + "EA2":{"EM":{"AM2": 0.15,"NM2": 0.15,"conv": 250}}, + "EM":{"IM":{"AM2": 1.95,"NM2":0.0195,"conv": 93}, + "IML":{"AM2": 0.98,"NM2":0.098,"conv": 110}}, + "IM":{"EM":{"GA": 9.0, "conv":22}, + "IM":{"GA": 4.5, "conv": 31}, + "IML":{"GA": 4.5, "conv": 17}}, + "IML":{"EM":{"GA2": 2.5, "conv": 8}, + "IM":{"GA2": 2.25, "conv": 12}, + "IML":{"GA2": 4.5, "conv": 2}}, + "IMUP":{"IMUP":{"GA": 1.25,"p": 0.15}}, + "IMDOWN":{"IMDOWN":{"GA": 1.25,"p": 0.15}}, + }, +RLconns: +"FeedForwardAtoM": 1, +"FeedForwardA2toM": 1 + + "allpops": { + "EV1": 6400, + "EV1DE": 400, + "EV1DNE": 400, + "EV1DN": 400, + "EV1DNW": 400, + "EV1DW": 400, + "EV1DSW": 400, + "EV1DS": 400, + "EV1DSE": 400, + "EA": 1400, + "EA2": 300, + "EMDOWN": 300, + "EMUP": 300, + "IM": 206, + "IML": 94, + }, + +-- testing full model with Feedforward connections and RL = 3 only betweem A and M areas. + + +-- make these changes in simFull.json on falcor.... + +"EXPDir": 0 +"stimModVD":20 +"stimModVL":20 (because there is no inhibition, so should use lower input weights) +VL to EA = 3 produces sparse activity in EA +VD to EA ... still fixing +VD to EA conv reducing from 320 to 40 to make sure similar effect of VD and VL on EA + +EA to EA2 ... 4.5 and conv = 250 +produced very low firing in EA2 (remember that racket is not moving so less input from EV1D) + +EA to EM ... 2.5 and conv = 250 +EA2 to EM .... 2.5 and conv = 250 +2.5 produced too high firing rates in EM and intermittent movements. + +reduce EM to IM and IML + + +---- +EA - EA2:reduce from 4.5 to 3. +EA - EM: increase from 1.5 to 3 +EA2 - EM: turn it off for now i.e. 0 + +--- +EA - EA2:reduce from 4.5 to 3. ---- ~17Hz so reduce +EA - EM: increase from 1.5 to 3 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + +--- +EA - EA2:reduce from 3 to 1. ---- +EA - EM: increase from 1.5 to 3 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + + +--- +EA - EA2:reduce from 3 to 1 to 0.5 ---- 0.04 Hz +EA - EM: increase from 1.5 to 3 to 4.5 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + +--- +EA - EA2:reduce from 3 to 1 to 0.5 ---- too low firing rate ~0.04 Hz +EA - EM: increase from 1.5 to 3 to 4.5 to 6 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + +--- +EA - EA2:reduce from 3 to 1 to 0.5 to 0.85 ---- +EA - EM: increase from 1.5 to 3 to 4.5 to 6 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + +----- +EA - EA2:reduce from 3 to 1 to 0.5 to 0.85 ---- +EA - EM: increase from 1.5 to 3 to 4.5 to 6 +EA2 - EM: turn it off for now i.e. 0 +also turn off inhibition +IM - EM: from 9 to 0 +IM - IM: from 4.5 to 0 +IM - IML: from 4.5 to 0 + +IML - EM: from 2.5 to 0 +IML - IM: from 2.25 to 0 +IML - IML: from 4.5 to 0 + + +---- + +to adjust FF conn weights for EA and EA2, i drove EM with noise. + +w = 10, rate = 100 + +EA is 1.3 Hz +EA2 is 0.14 Hz and very sparse. + + +-- looking at output of 21jan4_falcor_RL3_sim.json +looks like learning rate is too low. +change RLhebbwt from 0.001 to 0.1 +run 250 sec sim in 21jan5_falcor_RL3_ +EMDOWN-AM2: w=7, rate=100 +EMUP-AM2: w=7, rate=100 + +-- run 50 sec sim in 21jan5_falcor_RL3_A0_ +noise: +EMDOWN-AM2: w=5, rate=200 (2.21Hz) +EMUP-AM2: w=5, rate=200 (2.18Hz) + + +-- run 50 sec sim in 21jan5_falcor_RL3_A1_ +noise: +EA to EM- AM2:10 +EA2 to EM- AM2:10 +EMDOWN-AM2: w=2, rate=200 (0.21Hz) +EMUP-AM2: w=2, rate=200 (0.22Hz) + + +-- run 50 sec sim in 21jan5_falcor_RL3_A2_ +noise: +EA to EM- AM2:11 +EA2 to EM- AM2:11 +EMDOWN-AM2: w=2, rate=200 (0.42Hz) +EMUP-AM2: w=2, rate=200 (0.41Hz) + + +-- run 50 sec sim in 21jan5_falcor_RL3_A3_ + "followTarget": 0.02, + "avoidTarget": -0.01, + "hitBall": 0.2 + +noise: +EA to EM- AM2:12 +EA2 to EM- AM2:12 +EMDOWN-AM2: w=2, rate=200 (0.6 Hz) +EMUP-AM2: w=2, rate=200 (0.58 Hz) + +weights dont change much..... + +-- run 50 sec sim in 21jan5_falcor_RL3_A4_ +followTarget:0.1 +avoidTarget:-0.01 +hitBall:0.5 + +noise: +EA to EM- AM2:12 +EA2 to EM- AM2:12 +EMDOWN-AM2: w=2, rate=200 (0.69Hz) +EMUP-AM2: w=2, rate=200 (0.68Hz) + +RLhebbwt = 0.1 + +-- run 50 sec sim in 21jan5_falcor_RL3_A5_ +followTarget:0.1 +avoidTarget:-0.01 +hitBall:0.5 + +noise: +EA to EM- AM2:12 +EA2 to EM- AM2:12 +EMDOWN-AM2: w=2, rate=200 (0.78 Hz) +EMUP-AM2: w=2, rate=200 (0.78 Hz) + +RLhebbwt = 0.5 + +...possibly could be run for longer duration. + +-- run 500 sec sim in 21jan5_falcor_RL3_A6_ +followTarget:0.1 +avoidTarget:-0.01 +hitBall:0.5 + +noise: +EA to EM- AM2:12 +EA2 to EM- AM2:12 +EMDOWN-AM2: w=2, rate=200 (0.78 Hz) +EMUP-AM2: w=2, rate=200 (0.78 Hz) + +RLhebbwt = 0.5 + +...perf ~0.6 and increasing. +...average weight diverging... not a problem yet.....may be it is. +... firing rates look decent. +EMUP and EMDOWN = 1.11 Hz. +EA = 0.18 Hz. +EA2 = 0.17 Hz. +EV1 = 0.15 Hz. +..... + +resume sim as 21jan5_falcor_RL3_A6__step_1_ +...perf ~ 0.63 and may increase further. +EMUP and EMDOWN = 1.53 and 1.54 Hz. +EA = 0.19 Hz. +EA2 = 0.18 Hz. +EV1 = 0.15 Hz. + +resume sim as 21jan5_falcor_RL3_A6__step_2_ +perf peaked at 0.54 and then dropped to ~ 0.44 +firing rates all good but learning dropped. +give one more chance..... + +resume sim as 21jan5_falcor_RL3_A6__step_3_ +perf = 0.56 + +resume sim as 21jan5_falcor_RL3_A6__step_4_ (on jan6) + +... analyzing "21jan5_falcor_RL3_A6__step_4_" (on jan7) +saved perf as 21jan5_falcor_RL3_A6__step_4_perf.png...perf remains 0.6 for quite some time before dropping to 0.58... + +resume sim as 21jan5_falcor_RL3_A6__step_5_ (on jan7) +saved perf as 21jan5_falcor_RL3_A6__step_5_perf.png...perf remains 0.7 for quite some time before dropping to 0.63... + +resume sim as 21jan5_falcor_RL3_A6__step_6_ (on jan7) +saved perf as 21jan5_falcor_RL3_A6__step_6_perf.png...perf dropped to 0.58 again. + +resume sim as 21jan5_falcor_RL3_A6__step_7_ (on jan7) +saved perf as 21jan5_falcor_RL3_A6__step_7_perf.png...sustained at 0.57 again. (saved on jan8) +saved perf as 21jan5_falcor_RL3_A6__step_7_meanWeights.png (saved on jan8) + +no need to pursue further...... may be use same weights as in A6 with higher convergence in (21jan8_falcor_RL3_F6__step_0_). + +-------------------------------------------------------- +-- run 21jan5_falcor_RL1_A6__step_0_ +saved perf as 21jan5_falcor_RL1_A6__step_0_perf.png +saved raster as 21jan5_falcor_RL1_A6__step_0_raster.png +saved mean weights as 21jan5_falcor_RL1_A6__step_0_meanWeights.png + +resume sim as 21jan5_falcor_RL1_A6__step_1_ (on jan6) +saved perf as 21jan5_falcor_RL1_A6__step_1_perf.png ....performance dropped (BAD). +saved perf as 21jan5_falcor_RL1_A6__step_1_meanWeights.png ....mean weights start to diverge (BAD) + +dont resume further ...... + +----------------------------------------------------------------- + +-- run 21jan5_falcor_RL0_A6__step_0_ +saved perf as 21jan5_falcor_RL0_A6__step_0_perf.png +saved raster as 21jan5_falcor_RL0_A6__step_0_raster.png +saved mean weights as 21jan5_falcor_RL0_A6__step_0_meanWeights.png + +resume sim as 21jan5_falcor_RL0_A6__step_1_ (on jan6) +saved perf as 21jan5_falcor_RL0_A6__step_1_perf.png .... (BAD). +saved perf as 21jan5_falcor_RL0_A6__step_1_meanWeights.png + +dont resume further...... + +------------------------------------------------ +ONE POSSIBILITY: test different RL parameters. + +-- run 21jan5_falcor_RL3_B6__step_0_ + "RLlenhebb": 100, (changed from 500) + "RLlenanti": 100, (changed from 500) + +saved perf as 21jan5_falcor_RL3_B6__step_0_perf.png +saved raster as 21jan5_falcor_RL3_B6__step_0_raster.png +saved mean weights as 21jan5_falcor_RL3_B6__step_0_meanWeights.png + +may need to increase RLhebbwt but will do in seperate set of sims. + +resume sim as 21jan5_falcor_RL3_B6__step_1_ (on jan6) + +saved perf as 21jan5_falcor_RL3_B6__step_1_perf.png +saved raster as 21jan5_falcor_RL3_B6__step_1_raster.png +saved mean weights as 21jan5_falcor_RL3_B6__step_1_meanWeights.png + +resume sim as 21jan5_falcor_RL3_B6__step_2_ (on jan6) + +.... analyzing 21jan5_falcor_RL3_B6__step_2_ (on jan7) +saved perf as 21jan5_falcor_RL3_B6__step_2_perf.png ..... perf flat around 0.4 + +not sure if this will improve.... may be should not pursue this further (jan 7) + +--------------------------------------------------- +ANOTHER POSSIBILITY: reduce or remove noise. + +-- run 21jan5_falcor_RL3_C6__step_0_ (on jan 6) + "RLlenhebb": 100, (changed from 500) + "RLlenanti": 100, (changed from 500) +noise: EMDOWN-AM2: w=1, rate=200 + EMUP-AM2: w=1, rate=200 +RLhebbwt: 1 (was 0.5 in 21jan5_falcor_RL3_B6__step_0_ and 21jan5_falcor_RL3_A6__step_1_) +... not good performance... dont pursue.... + +--------------------------------------------------- + +-- run 21jan5_falcor_RL3_D6__step_0_ (on jan 6) +"RLlenhebb": 100, (changed from 500) + "RLlenanti": 100, (changed from 500) +noise: EMDOWN-AM2: w=2, rate=200 + EMUP-AM2: w=2, rate=200 +RLhebbwt: 1 (was 0.5 in 21jan5_falcor_RL3_B6__step_0_ and 21jan5_falcor_RL3_A6__step_1_) + +...... analyzing 21jan5_falcor_RL3_D6__step_0_ (on jan 7) +saved performance as 21jan5_falcor_RL3_D6__step_0_perf.png ~0.4 + +-------------------------------------------------- + +-- run 21jan5_falcor_RL3_E6__step_0_ (on jan 6) +"RLlenhebb": 100, (changed from 500) + "RLlenanti": 100, (changed from 500) +noise: EMDOWN-AM2: w=2, rate=200 + EMUP-AM2: w=2, rate=200 +RLhebbwt: 2 + +...... analyzing 21jan5_falcor_RL3_E6__step_0_ (on jan 7) +saved performance as 21jan5_falcor_RL3_E6__step_0_perf.png ~0.54 + +..... resume 21jan5_falcor_RL3_E6__step_1_ (on jan 7) +saved performance as 21jan5_falcor_RL3_E6__step_1_perf.png ~0.7 + +..... resume 21jan5_falcor_RL3_E6__step_2_ (on jan 7) +saved performance as 21jan5_falcor_RL3_E6__step_2_perf.png .... perf dropped to ~0.62 + +..... resume 21jan5_falcor_RL3_E6__step_3_ (on jan 7) +saved performance as 21jan5_falcor_RL3_E6__step_3_perf.png .... .... perf stays around 0.8 for quite sometime before dropping to 0.67 at the end. + +..... resume 21jan5_falcor_RL3_E6__step_4_ (on jan 8) +saved performance as 21jan5_falcor_RL3_E6__step_3_perf.png ....dropped to ~ 0.57 + +.... run resume 21jan5_falcor_RL3_E6__step_1long_ for 2500 sec (on jan7) + +.... analyzing all 5 steps on Jan11. +lfn = ['21jan5_falcor_RL3_E6__step_0_','21jan5_falcor_RL3_E6__step_1_','21jan5_falcor_RL3_E6__step_2_','21jan5_falcor_RL3_E6__step_3_','21jan5_falcor_RL3_E6__step_4_'] +pdac = getconcatactionreward(lfn) +saved performance as 21jan11_21jan5_falcor_RL3_E6_allsteps_perf.png ....0.62 to 0.64 (GOOD to pursue further) +saved performance as 21jan11_21jan5_falcor_RL3_E6_allsteps_compareperf.png +saved mean weights as +----------------------------------------------- +cp backupcfg/21jan5_falcor_RL3_A6__step_1_sim.json simFull.json +ResumeSim: 0 +name: 21jan8_falcor_RL3_F6__step_0_ +EA to EM: change 'conv' from 30 to 300...AM2 still 12 (probably will need to readjust) +EA2 to EM: change 'conv' from 30 to 300 ... AM2 still 12 (probably will need to change) + +-- run 21jan8_falcor_RL3_F6__step_0_ (on jan8) ... too high firing rates and not great perf. + +-- run 21jan11_falcor_RL3_F6__step_0_ +EA to EM: reduce AM2 from 12 to 8 +EA to EM: reduce AM2 from 12 to 8 +change wbase from 5 to 2. +saved performance as 21jan11_falcor_RL3_F6__step_0_perf.png (Jan12) perf ~ 0.8 (GOOD PERFORMANCE..pursue further) +saced meanweights as 21jan11_falcor_RL3_F6__step_0_meanweights.png (Jan12) +saved animinput as gif/21jan12_21jan11_falcor_RL3_F6__step_0__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_1_ (Jan12) +saved performance as 21jan11_falcor_RL3_F6__step_1_perf.png (Jan13) perf dropped to ~ 0.65 (GOOD PERFORMANCE..pursue further) +saved meanweights as 21jan11_falcor_RL3_F6__step_1_meanweights.png (Jan13) +saved animinput as gif/21jan13_21jan11_falcor_RL3_F6__step_1__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_2_ (Jan13) +only problem is firing rates of M quite high ~ 27Hz +saved performance as 21jan11_falcor_RL3_F6__step_2_perf.png (Jan14) perf dropped to ~ 0.72 (GOOD PERFORMANCE..pursue further) +saved meanweights as 21jan11_falcor_RL3_F6__step_2_meanweights.png (Jan14) +saved animinput as gif/21jan14_21jan11_falcor_RL3_F6__step_2__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_3_ (Jan14) +only problem is firing rates of M quite high ~ 28Hz +saved performance as 21jan11_falcor_RL3_F6__step_3_perf.png (Jan15) perf dropped to ~ 0.66 (GOOD PERFORMANCE..pursue further) +saved meanweights as 21jan11_falcor_RL3_F6__step_3_meanweights.png (Jan15) +saved animinput as gif/21jan15_21jan11_falcor_RL3_F6__step_3__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_4_ (Jan15) +saved performance as 21jan11_falcor_RL3_F6__step_4_perf.png (Jan16) perf ~ 0.73 and increasing (GOOD PERFORMANCE..pursue further) +saved meanweights as 21jan11_falcor_RL3_F6__step_4_meanweights.png (Jan16) +saved animinput as gif/21jan16_21jan11_falcor_RL3_F6__step_4__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_5_ (Jan16)....restarted on (Jan19) +saved performance as 21jan11_falcor_RL3_F6__step_5_perf.png (Jan20) perf ~0.88 (Excellent performance) +saved meanweights as 21jan11_falcor_RL3_F6__step_5_meanweights.png (Jan20) +saved animinput as gif/21jan20_21jan11_falcor_RL3_F6__step_5__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_6_ (Jan20) +saved performance as 21jan11_falcor_RL3_F6__step_6_perf.png (Jan21) perf ~0.8 (Good performance) +saved meanweights as 21jan11_falcor_RL3_F6__step_6_meanweights.png (Jan21) +saved animinput as gif/21jan21_21jan11_falcor_RL3_F6__step_6__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_7_ (Jan21) + +saved performance as 21jan11_falcor_RL3_F6__step_7_perf.png (Jan22) performance dropped to ~0.6 (OK performance) +saved meanweights as 21jan11_falcor_RL3_F6__step_7_meanweights.png (Jan22) +saved animinput as gif/21jan22_21jan11_falcor_RL3_F6__step_7__with_reward_input.mp4 + +-- resume 21jan11_falcor_RL3_F6__step_8_ (Jan22) + +saved cummulative performance as 21jan26_21jan11_falcor_RL3_F6__steps_0_to8_perf.png (performance = 0.73....so far best) +saved individual performances as 21jan26_21jan11_falcor_RL3_F6__steps_0_to8_compareperf.png (performances are in range of 0.6 to 0.89....so far best) + +-- resume 21jan11_falcor_RL3_F6__step_9_ (Jan27)...just for completing 10 steps. + + +.....now try with initial weights..... + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p0_ + "yball": 80, + "yracket": 40, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p1_ + "yball": 100, + "yracket": 20, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p1_", + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p2_ + "yball": 120, + "yracket": 10, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p2_", + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p3_ + "yball": 10, + "yracket": 120, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p3_", + +.....start here on Jan28 + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p4_ + "yball": 20, + "yracket": 100, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p4_", + +-- run sim 21jan27_21jan11_falcor_F6_RLhebbwt_0_p5_ + "yball": 40, + "yracket": 80, + "ResumeSim": 0 + "name": "21jan27_21jan11_falcor_F6_RLhebbwt_0_p5_", + +...now for each weight snapshot after training, run 6 positions. + +-- run sim 21jan27_21jan11_falcor_F6__step_0_RLhebbwt_0_p0_ + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_0_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_0_RLhebbwt_0_p0_", + + +-- run sim 21jan27_21jan11_falcor_F6__step_1_RLhebbwt_0_p0_ + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_1_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_1_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_2_RLhebbwt_0_p0_ (Feb1) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_2_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_2_RLhebbwt_0_p0_", + + +-- run sim 21jan27_21jan11_falcor_F6__step_3_RLhebbwt_0_p0_ (Feb1) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_3_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_3_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_4_RLhebbwt_0_p0_ (Feb2) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_4_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_4_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_5_RLhebbwt_0_p0_ (Feb2) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_5_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_5_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_6_RLhebbwt_0_p0_ (Feb3) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_6_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_6_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_7_RLhebbwt_0_p0_ (Feb3) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_7_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_7_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_8_RLhebbwt_0_p0_ (Feb4) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_8_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_8_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_9_RLhebbwt_0_p0_ (Feb4) + "yball": 80, + "yracket": 40, + "ResumeSim": 1 + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_9_synWeights_final.pkl" + "name": "21jan27_21jan11_falcor_F6__step_9_RLhebbwt_0_p0_", + +-- run sim 21jan27_21jan11_falcor_F6__step_9_RLhebbwt_0_p1_ (Feb5) +duration: 2000 sec (instead of 500) + "yball": 100, + "yracket": 20, + "ResumeSim": 0 + +-- run sim 21jan27_21jan11_falcor_F6__step_8_RLhebbwt_0_p1_ (Feb5) +duration: 2000 sec (instead of 500) + "yball": 100, + "yracket": 20, + "ResumeSim": 0 +------------------------------------------------- +-- run 21jan12_falcor_RL3_G6__step_0_ (Jan12) +EA to EM: reduce AM2 to 7 +EA to EM: reduce AM2 to 7 +saved performance as 21jan12_falcor_RL3_G6__step_0_perf.png (Jan13)...0.52 (may improve) + +-- resume 21jan12_falcor_RL3_G6__step_1_ (Jan13) +saved performance as 21jan12_falcor_RL3_G6__step_1_perf.png (Jan14)...0.57 (may improve) +.... too high firing rates.....EM ~25Hz. + +-- resume 21jan12_falcor_RL3_G6__step_2_ (Jan14) +saved performance as 21jan12_falcor_RL3_G6__step_2_perf.png (Jan15)...drops to ~ 0.88 (EXCELLENT) +.... too high firing rates.....EM ~26Hz. +saved animinput as gif/21jan15_21jan12_falcor_RL3_G6__step_2__with_reward_input.mp4 + +-- resume 21jan12_falcor_RL3_G6__step_3_ (Jan15) + +-- resume 21jan12_falcor_RL3_G6__step_4_ (Jan16)...restarted on (Jan19) +sim got terminated.... abandoning...... + +----------------------------------------------- +ANALYSIS ON CYCLE SIMS: + +A is for RL = 0 +B is for RL = 3 +D is for RL = 1 + +----------------------------------------------------------------- +RL = 0 + +>>> lfn = [ '20dec27_A0_cycle_reduced_2obj_INTF7__step_0_', + '20dec27_A0_cycle_reduced_2obj_INTF7__step_1_', + '20dec27_A0_cycle_reduced_2obj_INTF7__step_2_', + '20dec27_A0_cycle_reduced_2obj_INTF7__step_3_', + '20dec27_A0_cycle_reduced_2obj_INTF7__step_4_', + '20dec30_A0_cycle_reduced_2obj_INTF7__step_0_', + '20dec30_A0_cycle_reduced_2obj_INTF7__step_1_', + '20dec30_A0_cycle_reduced_2obj_INTF7__step_2_', + '20dec30_A0_cycle_reduced_2obj_INTF7__step_3_', + '20dec30_A0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) +saved as 21jan06_20dec27_A0_5steps_20dec30_A0_5steps_perf.png + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +saved as 21jan06_20dec27_A0_5steps_20dec30_A0_5steps_comparePerf.png + +>>> pdfc = getconcatweightpdf(lfn) +>>> plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMDOWN','EMUP'],lclr=['r','b'],plotindiv=False) +saved as 21jan06_20dec27_A0_5steps_20dec30_A0_5steps_meanWeights.png + + +CONTROL for RL = 0 (chose sim "20dec30_A0_cycle_reduced_2obj_INTF7__step_0_" with highest perf ~ 0.8 decaying to 0.55) + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/20dec30_A0_cycle_reduced_2obj_INTF7__step_1_sim.json sim.json + +"ResumeSim": 1, +"ResumeSimFromFile": "data/20dec30_A0_cycle_reduced_2obj_INTF7__step_0_synWeights_final.pkl" +"name": "21jan06_A0_cycle_reduced_2obj_INTF7__trial_0_" +RLhebbwt = 0 + +mpiexec -n 20 nrniv -python -mpi sim.py sim.json + +perf and weights are saved as + +21jan07_21jan06_A0_cycle_reduced_2obj_INTF7__trial_0__meanWeights.png +21jan07_21jan06_A0_cycle_reduced_2obj_INTF7__trial_0__perf.png + +............. + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan06_A0_cycle_reduced_2obj_INTF7__trial_0_sim.json sim.json + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec30_A0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" + "name": "21jan06_A0_cycle_reduced_2obj_INTF7__trial_1_" +mpiexec -n 20 nrniv -python -mpi sim.py sim.json (run on jan7) + +--analyzing on jan8 + +perf and weights are saved as + +21jan07_21jan06_A0_cycle_reduced_2obj_INTF7__trial_1__perf.png (on jan8) +21jan07_21jan06_A0_cycle_reduced_2obj_INTF7__trial_1__meanWeights.png (on jan8) + +------------------------------------------------------------------------------- +RL = 3 + +>>> lfn = ['20dec27_B0_cycle_reduced_2obj_INTF7__step_0_','20dec27_B0_cycle_reduced_2obj_INTF7__step_1_','20dec27_B0_cycle_reduced_2obj_INTF7__step_2_','20dec27_B0_cycle_reduced_2obj_INTF7__step_3_','20dec27_B0_cycle_reduced_2obj_INTF7__step_4_','20dec30_B0_cycle_reduced_2obj_INTF7__step_0_','20dec30_B0_cycle_reduced_2obj_INTF7__step_1_','20dec30_B0_cycle_reduced_2obj_INTF7__step_2_','20dec30_B0_cycle_reduced_2obj_INTF7__step_3_','20dec30_B0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) +saved as 21jan06_20dec27_B0_5steps_20dec30_B0_5steps_perf.png + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +saved as 21jan06_20dec27_B0_5steps_20dec30_B0_5steps_comparePerf.png + +>>> pdfc = getconcatweightpdf(lfn) +>>> plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMDOWN','EMUP'],lclr=['r','b'],plotindiv=False) +saved as 21jan06_20dec27_B0_5steps_20dec30_B0_5steps_meanWeights.png + +CONTROL for RL = 3 (chose sim "20dec27_B0_cycle_reduced_2obj_INTF7__step_4_" with highest perf ~ 0.8) + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/20dec30_B0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json + +"ResumeSim": 1, +"ResumeSimFromFile": "data/20dec27_B0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" +"name": "21jan06_B0_cycle_reduced_2obj_INTF7__trial_0_", +RLhebbwt = 0 + +mpiexec -n 20 nrniv -python -mpi sim.py sim.json + +perf and weights are saved as + +21jan07_21jan06_B0_cycle_reduced_2obj_INTF7__trial_0__meanWeights.png +21jan07_21jan06_B0_cycle_reduced_2obj_INTF7__trial_0__perf.png + +fig = animInput(InputImages,gifpath()+'_with_reward_input.mp4',actreward=actreward) + +saved animation to gif/21jan8_21jan06_B0_cycle_reduced_2obj_INTF7__trial_0__with_reward_input.mp4 (at the end of learning step 4) +saved animation to gif/21jan8_20dec27_B0_cycle_reduced_2obj_INTF7__step_4__with_reward_input.mp4 (during the learning step 4) +......................................... + + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_B0_cycle_reduced_2obj_INTF7__step_2_synWeights_final.pkl" + +"name": "21jan06_B0_cycle_reduced_2obj_INTF7__trial_1_", + +mpiexec -n 20 nrniv -python -mpi sim.py sim.json (run on jan 7) + +--analyzing on jan8 + +perf and weights are saved as + +21jan07_21jan06_B0_cycle_reduced_2obj_INTF7__trial_1__meanWeights.png +21jan07_21jan06_B0_cycle_reduced_2obj_INTF7__trial_1__perf.png + +saved animation to gif/21jan8_21jan06_B0_cycle_reduced_2obj_INTF7__trial_1__with_reward_input.mp4 (at the end of learning step 2) +saved animation to gif/21jan8_20dec27_B0_cycle_reduced_2obj_INTF7__step_2__with_reward_input.mp4 (during the learning step 2) +------------------------------------------------------------------------------- + +RL = 1 + +>>> lfn = ['20dec27_D0_cycle_reduced_2obj_INTF7__step_0_','20dec27_D0_cycle_reduced_2obj_INTF7__step_1_','20dec27_D0_cycle_reduced_2obj_INTF7__step_2_','20dec27_D0_cycle_reduced_2obj_INTF7__step_3_','20dec27_D0_cycle_reduced_2obj_INTF7__step_4_','20dec30_D0_cycle_reduced_2obj_INTF7__step_0_','20dec30_D0_cycle_reduced_2obj_INTF7__step_1_','20dec30_D0_cycle_reduced_2obj_INTF7__step_2_','20dec30_D0_cycle_reduced_2obj_INTF7__step_3_','20dec30_D0_cycle_reduced_2obj_INTF7__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) +saved as 21jan06_20dec27_D0_5steps_20dec30_D0_5steps_perf.png + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +saved as 21jan06_20dec27_D0_5steps_20dec30_D0_5steps_comparePerf.png + + +>>> pdfc = getconcatweightpdf(lfn) +>>> plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMDOWN','EMUP'],lclr=['r','b'],plotindiv=False) +saved as 21jan06_20dec27_D0_5steps_20dec30_D0_5steps_meanWeights.png + +... now run control using 20dec27_D0_cycle_reduced_2obj_INTF7__step_4_ + +CONTROL for RL = 1 (chose sim "20dec27_D0_cycle_reduced_2obj_INTF7__step_4_" with highest perf ~ 1) + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/20dec30_D0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json + + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_D0_cycle_reduced_2obj_INTF7__step_4_synWeights_final.pkl" + "name": "21jan06_D0_cycle_reduced_2obj_INTF7__trial_0_", +RLhebbwt = 0 + +mpiexec -n 20 nrniv -python -mpi sim.py sim.json + +perf and weights are saved as + +21jan07_21jan06_D0_cycle_reduced_2obj_INTF7__trial_0__meanWeights.png +21jan07_21jan06_D0_cycle_reduced_2obj_INTF7__trial_0__perf.png + +................................. + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/20dec30_D0_cycle_reduced_2obj_INTF7__step_0_sim.json sim.json + + "ResumeSim": 1, + "ResumeSimFromFile": "data/20dec27_D0_cycle_reduced_2obj_INTF7__step_2_synWeights_final.pkl" + "name": "21jan06_D0_cycle_reduced_2obj_INTF7__trial_1_", +mpiexec -n 20 nrniv -python -mpi sim.py sim.json (run on jan 7) + + + + +--------------------------------------------------------- + +-- run basic control +resume = 0 +"name": "21jan06_R0_cycle_reduced_2obj_INTF7__trial_0_", + +perf and weights are saved as + +21jan07_21jan06_R0_cycle_reduced_2obj_INTF7__trial_0__meanWeights.png +21jan07_21jan06_R0_cycle_reduced_2obj_INTF7__trial_0__perf.png + +-------------------------------------------------------- + +IMPORTANT (RELATED TO REDUCED MODEL): + +Since i was running the reduced model using scripts from before the recent update +......(AM was changed to AM2 etc and more details included in the model) + +so i am making a backup on cycle just in case, if i cant reproduce my results while using new scripts...... +/home/hanwar/GamesProject/SMARTAgent_BACKUP + +....copy all figures to personal computer.... +(base) AnwarHaroons-MacBook-Pro:SMARTAgent anwarharoon$ scp hanwar@10.76.252.198:/home/hanwar/GamesProject/SMARTAgent/*.png figs_cycle_21Jan8/. +.... copy all movies to personal computer.... +(base) AnwarHaroons-MacBook-Pro:videos anwarharoon$ scp hanwar@10.76.252.198:/home/hanwar/GamesProject/SMARTAgent/gif/*.mp4 . + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ git stash +Saved working directory and index state WIP on master: 0aec41c use simFull.json for more general architecture +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ git pull +remote: Enumerating objects: 181, done. +remote: Counting objects: 100% (181/181), done. +remote: Compressing objects: 100% (120/120), done. +remote: Total 181 (delta 123), reused 112 (delta 61), pack-reused 0 +Receiving objects: 100% (181/181), 530.67 KiB | 2.59 MiB/s, done. +Resolving deltas: 100% (123/123), completed with 4 local objects. +From github.com:NathanKlineInstitute/SMARTAgent + 0aec41c..2850c3e master -> origin/master + d4aeacb..d691696 development -> origin/development +Updating 0aec41c..2850c3e +Fast-forward + cells/intf7.py | 65 +----- + conf.py | 2 + + connUtils.py | 14 +- + hanotes.org | 1181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- + sim.json | 1226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- + sim.py | 603 +++++++++++++++++++++++------------------------- + simFull.json | 328 +++++++++++++++++--------- + simReduced.json | 691 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + simdat.py | 7 +- + sn.json | 282 ++++++++++++++++------- + snnotes.org | 1356 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 11 files changed, 4760 insertions(+), 995 deletions(-) + create mode 100644 simReduced.json +--------------------------------------------------------- +sam was using these RLconns in sn.json: + + "RLconns": { + "EIPlast": 0, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoA2": 0, + "FeedForwardLocNtoA2": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 1, + "FeedForwardAtoA2": 1, + "FeedForwardA2toM": 1, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 1, + "RecurrentANeurons": 1, + "RecurrentA2Neurons": 1, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 1, + "FeedbackMtoA2": 1, + "FeedbackA2toA": 1 + }, + +--------------------------------------------------------- + +::::::EXPLORE NEW FULL MODEL ON CYCLE NOW::::::: +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp sn.json simFull.json + +"name": "21jan8_TARG4_cycle_RL3_" +"targettedRL": 3, + + "FeedForwardAtoM": 1, + "FeedForwardAtoA2": 0, (was 1 in sn.json) + "FeedForwardA2toM": 1, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 1, + "RecurrentANeurons": 0, (was 1 in sn.json) + "RecurrentA2Neurons": 0, (was 1 in sn.json) + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 1, + "FeedbackMtoA2": 1, + "FeedbackA2toA": 0 (was 1 in sn.json) + +there were 9 conn types under RL before (in sn.json). +Now there are only 5 conn types (only between A and M and within M) under RL. + +-- start a multistepsim.... +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFull.json 30 5 21jan8_RL3_cycle_multi + +-- start another multistepsim.... +"name": "21jan8_TARG4_cycle_RL1_" +"targettedRL": 1, +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFull.json 20 5 21jan8_RL1_cycle_multi + +-- start another multistepsim..... +"name": "21jan8_TARG4_cycle_" +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py sn.json 20 5 21jan8_RL4_cycle_multi + +* DONE 2021jan11 + +-- analyzing multistepsims from jan8 on cycle. + +RL3: + +>>> lfn =['21jan8_TARG4_cycle_RL3__step_0_', + '21jan8_TARG4_cycle_RL3__step_1_', + '21jan8_TARG4_cycle_RL3__step_2_', + '21jan8_TARG4_cycle_RL3__step_3_', + '21jan8_TARG4_cycle_RL3__step_4_'] +>>> pdac = getconcatactionreward(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL3_steps0to4_perf.png .... flat at ~0.37 + +>>> lpda = getindivactionreward(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL3_steps0to4_compareperf.png + +>>> pdfc = getconcatweightpdf(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL3_steps0to4_EM_meanweights.png +saved as 21jan11_21jan8_TARG4_cycle_RL3_steps0to4_EAandEA2_meanweights.png....decreasing...thought these weights should be fixed. + +... should rerun with fixed EA and EA2 conn weights..... + + cp backupcfg/21jan8_TARG4_cycle_RL3__step_0_sim.json simFull.json + +"name": "21jan11_TARG4_cycle_RL3__step_0_", + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + + python multistepSim.py simFull.json 20 5 21jan11_RL3_cycle_multi + +....analyzing (Jan12): + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/21jan11_TARG4_cycle_RL3__step_0__step_0_sim.json +reading backupcfg/21jan11_TARG4_cycle_RL3__step_0__step_0_sim.json +-1 +lpop: ['EV1', 'EMDOWN', 'EMUP', 'IM'] +loading data from 21jan11_TARG4_cycle_RL3__step_0__step_0_ +loading input images from data/21jan11_TARG4_cycle_RL3__step_0__step_0_InputImages.txt +loaded simulation data 21jan11_TARG4_cycle_RL3__step_0__step_0_ on 21jan12_ +EV1 0.02 Hz +EA 1.74 Hz +IA 4.23 Hz +IAL 0.23 Hz +EA2 0.11 Hz +IA2 1.21 Hz +IA2L 1.72 Hz +EMDOWN 0.2 Hz +EMUP 0.2 Hz +IM 1.41 Hz +IML 2.11 Hz + +>>> lfn =['21jan11_TARG4_cycle_RL3__step_0__step_0_','21jan11_TARG4_cycle_RL3__step_0__step_1_','21jan11_TARG4_cycle_RL3__step_0__step_2_','21jan11_TARG4_cycle_RL3__step_0__step_3_', '21jan11_TARG4_cycle_RL3__step_0__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) +performance saved as 21jan12_21jan11_TARG4_cycle_RL3_steps0to4_perf.png (~0.32 BAD) + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +performance saved as 21jan12_21jan11_TARG4_cycle_RL3_steps0to4_compareperf.png (all BAD) + +-------------------------------- +RL1: + +>>> lfn =['21jan8_TARG4_cycle_RL1__step_0_', + '21jan8_TARG4_cycle_RL1__step_1_', + '21jan8_TARG4_cycle_RL1__step_2_', + '21jan8_TARG4_cycle_RL1__step_3_', + '21jan8_TARG4_cycle_RL1__step_4_'] +>>> pdac = getconcatactionreward(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL1_steps0to4_perf.png .... flat at ~0.4 + +>>> lpda = getindivactionreward(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL1_steps0to4_compareperf.png + +>>> pdfc = getconcatweightpdf(lfn) +saved as 21jan11_21jan8_TARG4_cycle_RL1_steps0to4_EM_meanweights.png +saved as 21jan11_21jan8_TARG4_cycle_RL1_steps0to4_EAandEA2_meanweights.png + +... should rerun with fixed EA and EA2 conn weights..... + +cp backupcfg/21jan8_TARG4_cycle_RL1__step_0_sim.json simFull.json + +"name": "21jan11_TARG4_cycle_RL1__step_0_", + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + +>>> lfn =['21jan11_TARG4_cycle_RL1__step_0__step_0_','21jan11_TARG4_cycle_RL1__step_0__step_1_','21jan11_TARG4_cycle_RL1__step_0__step_2_','21jan11_TARG4_cycle_RL1__step_0__step_3_', '21jan11_TARG4_cycle_RL1__step_0__step_4_'] +>>> pdac = getconcatactionreward(lfn) +>>> plotPerf(pdac) + +performance saved as 21jan12_21jan11_TARG4_cycle_RL1_steps0to4_perf.png (~0.36 BAD) + +>>> lpda = getindivactionreward(lfn) +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +performance saved as 21jan12_21jan11_TARG4_cycle_RL1_steps0to4_compareperf.png (only last step (step_4 is good in the beginning)) + +------------- +RL0: + +basically same story... so didnt save any plots. + +... should rerun with fixed EA and EA2 conn weights..... + + + +------------------------------------------------ +analyzing sam's simulations from gcp. + +(base) hanwar@cycle:/home/samn/SMARTAgent$ python -i simdat.py backupcfg/21jan6_TARG4_gcp__step_0_sim.json +reading backupcfg/21jan6_TARG4_gcp__step_0_sim.json +-1 +lpop: ['EV1', 'EMDOWN', 'EMUP', 'IM'] +loading data from 21jan6_TARG4_gcp__step_0_ +loading input images from data/21jan6_TARG4_gcp__step_0_InputImages.txt +loaded simulation data 21jan6_TARG4_gcp__step_0_ on 21jan11_ +EV1 0.02 Hz +EA 1.74 Hz +IA 4.24 Hz +IAL 0.23 Hz +EA2 0.11 Hz +IA2 1.2 Hz +IA2L 1.72 Hz +EMDOWN 0.2 Hz +EMUP 0.2 Hz +IM 1.41 Hz +IML 2.11 Hz + + +>>> lfn =['21jan6_TARG4_gcp__step_0_','21jan6_TARG4_gcp__step_1_','21jan6_TARG4_gcp__step_2_','21jan6_TARG4_gcp__step_3_', '21jan6_TARG4_gcp__step_4_','21jan6_TARG4_gcp__step_5_','21jan6_TARG4_gcp__step_6_','21jan6_TARG4_gcp__step_7_','21jan6_TARG4_gcp__step_8_','21jan6_TARG4_gcp__step_9_','21jan6_TARG4_gcp__step_10_','21jan6_TARG4_gcp__step_11_','21jan6_TARG4_gcp__step_12_','21jan6_TARG4_gcp__step_13_','21jan6_TARG4_gcp__step_14_','21jan6_TARG4_gcp__step_15_','21jan6_TARG4_gcp__step_16_','21jan6_TARG4_gcp__step_17_','21jan6_TARG4_gcp__step_18_','21jan6_TARG4_gcp__step_19_'] +>>> len(lfn) +20 +>>> pdac = getconcatactionreward(lfn) +performance saved as 21jan11_21jan6_TARG4_gcp_steps0to19_perf.png ....flat at ~ 0.42 + + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn) +performance comparison for steps saved as 21jan11_21jan6_TARG4_gcp_steps0to19_compareperf.png + + + +EM mean weights saved as 21jan11_21jan6_TARG4_gcp_steps0to19_EM_meanweights.png +... may be M is primarily driven by noise. +... test that by running sim with weights from 21jan6_TARG4_gcp__step_19_ and reducing or turning off noise (may be both). + + +"ResumeSimFromFile": "data/21jan6_TARG4_gcp__step_19_synWeights_final.pkl" +"name": "21jan11_TARG4_gcp_cycle__step_19_NoNoise_" ---->check this in the morning. +(Jan12): nothing to pursue further. +-------------------------------------------------- + +(Jan12): run control for the best step of sim Sam had on gcp. + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp /home/samn/SMARTAgent/backupcfg/21jan11_TARG4_gcp__step_3_sim.json simFull.json + +in simFull.json + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_gcp__step_3_synWeights_final.pkl" + +"name": "21jan11_TARG4_gcp__step_3_RLhebbwt_0_", +RL: +AMPAI: "RLhebbwt": 0.0, (was 0.001 during training) +AMPA: "RLhebbwt": 0.0, (was 0.01 during training) +NMDA: "RLhebbwt": 0.0 (was 4e-06 during training) + + mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + + ---------- +(Jan12): run control for another best step of sim Sam had on gcp. + + (base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp /home/samn/SMARTAgent/backupcfg/21jan11_TARG4_B_gcp__step_3_sim.json simFull.json + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_B_gcp__step_2_synWeights_final.pkl" + + "name": "21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_", +RL: +AMPAI: "RLhebbwt": 0.0, (was 0.001 during training) +AMPA: "RLhebbwt": 0.0, (was 0.01 during training) +NMDA: "RLhebbwt": 0.0 (was 4e-06 during training) + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + +saving data failed for 500 sec sim. + +.... so ran 300 sec sim. + + python -i simdat.py backupcfg/21jan11_TARG4_gcp__step_3_RLhebbwt_0_sim.json + +(Jan13)........ +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp /home/samn/SMARTAgent/backupcfg/21jan11_TARG4_gcp__step_2_sim.json simFull.json +duration: 300 sec. + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_gcp__step_2_synWeights_final.pkl" + "name": "21jan11_TARG4_gcp__step_2_RLhebbwt_0_" + + set all RLhebbwt to 0. + + mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + + + + (Jan13): + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_gcp__step_1_synWeights_final.pkl" +"name": "21jan11_TARG4_gcp__step_1_RLhebbwt_0_", + + +----------------------------- + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_sim.json +reading backupcfg/21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_sim.json +-1 +lpop: ['EV1', 'EMDOWN', 'EMUP', 'IM'] +loading data from 21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_ +loading input images from data/21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_InputImages.txt +loaded simulation data 21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_ on 21jan12_ +EV1 0.02 Hz +EA 2.47 Hz +IA 6.0 Hz +IAL 0.82 Hz +EA2 0.46 Hz +IA2 1.65 Hz +IA2L 2.38 Hz +EMDOWN 0.46 Hz +EMUP 0.46 Hz +IM 1.94 Hz +IML 2.75 Hz + + + +This doesnt seem to be great: file:///home/samn/SMARTAgent/gif/21jan12_21jan11_TARG4_B_gcp__step_3_perf_compareD.png + +CONTROLS: +performance saved as 21jan12_21jan11_TARG4_B_gcp__step_3_RLhebbwt_0__perf.png (300 sec) + + +--------------------------------------------------------- +Use this figure to evaluate controls: +file:///home/samn/SMARTAgent/gif/21jan12_21jan11_TARG4_gcp__step_3_perf_compareD.png + +-- run 21jan11_TARG4_gcp__step_1_RLhebbwt_0_ (Jan13)(500 sec) +performance saved as 21jan14_21jan11_TARG4_gcp__step_1_RLhebbwt_0_perf.png (Jan14) (EXCELLENT) + +-- run 21jan11_TARG4_gcp__step_0_RLhebbwt_0_ (Jan14) (500 sec) +performance saved as 21jan14_21jan11_TARG4_gcp__step_0_RLhebbwt_0_perf.png (Jan14) (NOT GOOD.. perf ~ = 0.42) + +...start all from the beginning.... + +--(Jan14) run control for step_0_: +use this /home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_0_synWeights_final.pkl + +cp /home/samn/SMARTAgent/backupcfg/21jan6_TARG4_gcp__step_1_sim.json simFull.json + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_0_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_" +performance saved as 21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_perf.png (VERY GOOD) + + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_1_synWeights_final.pkl" + "name": "21jan14_21jan6_TARG4_gcp__step_1_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_1_RLhebbwt_0_perf.png (NOT GOOD) + + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_2_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_2_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_2_RLhebbwt_0_perf.png (NOT GOOD) + + + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_3_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_3_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_3_RLhebbwt_0_perf.png (Jan15) (NOT GOOD) + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_4_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_4_RLhebbwt_0_" +performance saved as 21jan14_21jan6_TARG4_gcp__step_4_RLhebbwt_0_perf.png (Jan15) (NOT GOOD) + + +"ResumeSim": 1, (Jan14) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_5_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_5_RLhebbwt_0_" +performance saved as 21jan14_21jan6_TARG4_gcp__step_5_RLhebbwt_0_perf.png (Jan15) (NOT GOOD) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_6_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_6_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_6_RLhebbwt_0_perf.png (Jan15) (NOT GOOD) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_7_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_7_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_7_RLhebbwt_0_perf.png (NOT GREAT BUT OK) + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_8_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_8_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_8_RLhebbwt_0_perf.png (Not good) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_9_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_9_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_9_RLhebbwt_0_perf.png (Not good) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_10_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_10_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_10_RLhebbwt_0_perf.png ....(not great but good) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_11_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_11_RLhebbwt_0_", +performance saved as 21jan14_21jan6_TARG4_gcp__step_11_RLhebbwt_0_perf.png ....(not great but good) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_12_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_12_RLhebbwt_0_", +(Jan16): performance saved as 21jan14_21jan6_TARG4_gcp__step_12_RLhebbwt_0_perf.png (not good). + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_13_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_13_RLhebbwt_0_", +(Jan16): performance saved as 21jan14_21jan6_TARG4_gcp__step_13_RLhebbwt_0_perf.png (bad) + + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_14_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_14_RLhebbwt_0_", +(Jan16) performance saved as 21jan14_21jan6_TARG4_gcp__step_14_RLhebbwt_0_perf.png (not good) + +"ResumeSim": 1, (Jan15) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_15_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_15_RLhebbwt_0_", +(Jan16) performance saved as 21jan14_21jan6_TARG4_gcp__step_15_RLhebbwt_0_perf.png (not good) + +"ResumeSim": 1, (Jan16) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_16_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_16_RLhebbwt_0_", +(Jan19) performance saved as 21jan14_21jan6_TARG4_gcp__step_16_RLhebbwt_0_perf.png (bad) + +"ResumeSim": 1, (Jan16) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_17_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_17_RLhebbwt_0_", +(Jan19) performance saved as 21jan14_21jan6_TARG4_gcp__step_17_RLhebbwt_0_perf.png (bad) + +"ResumeSim": 1, (Jan16) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_18_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_18_RLhebbwt_0_" +(Jan19) performance saved as 21jan14_21jan6_TARG4_gcp__step_18_RLhebbwt_0_perf.png (bad) + +"ResumeSim": 1, (Jan16) +"ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan6_TARG4_gcp__step_19_synWeights_final.pkl" +"name": "21jan14_21jan6_TARG4_gcp__step_19_RLhebbwt_0_" +(Jan19) performance saved as 21jan14_21jan6_TARG4_gcp__step_19_RLhebbwt_0_perf.png (OK. perf stays above ~0.6) + + +-- analyzing all controls: (Jan19) + +>>> lfn =['21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_1_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_2_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_3_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_4_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_5_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_6_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_7_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_8_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_9_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_10_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_11_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_12_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_13_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_14_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_15_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_16_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_17_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_18_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_19_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_0_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_1_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_2_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_3_RLhebbwt_0_'] +>>> lpda = getindivactionreward(lfn) +pdfc = getconcatweightpdf(lfn) + plotMeanWeights(pdfc,gca(),msz=6,xl=(0,np.amax(pdfc.time)),lpop=['EMUP','EMDOWN'],lclr=['r','b'],plotindiv=False) +21jan19_TARG4_gcp__AllStepsControls_RLhebbwt_0__meanweights.png (EMDOWN is always higher than EMUP weights on average) + +-- based on the best controls: test some more initial positions for the ball.... + +good ones are.... + +21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_ (2nd best) + +21jan14_21jan6_TARG4_gcp__step_7_RLhebbwt_0_ (may be) +21jan14_21jan6_TARG4_gcp__step_10_RLhebbwt_0_ (may be) +21jan14_21jan6_TARG4_gcp__step_11_RLhebbwt_0_ +21jan14_21jan6_TARG4_gcp__step_12_RLhebbwt_0_ (may be) +21jan14_21jan6_TARG4_gcp__step_19_RLhebbwt_0_ + +21jan11_TARG4_gcp__step_1_RLhebbwt_0_ (Best) --- DONE for 5 other positions + +...start with best +cp backupcfg/21jan11_TARG4_gcp__step_1_RLhebbwt_0_sim.json simFull.json + +original was + "yball": 80, + "yracket": 40, + +-- run sim 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_ (Jan19) + + "yball": 100, + "yracket": 20, + "name": "21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_", + +-- 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_ (Jan19) + + "yball": 120, + "yracket": 10, + "name": "21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_", + +-- 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_ (Jan19) + + "yball": 10, + "yracket": 120, + "name": "21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_", + +-- 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_ (Jan19) + + "yball": 20, + "yracket": 100, + "name": "21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_", + +-- 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_ (Jan19) + + "yball": 40, + "yracket": 80, + "name": "21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_", + + + +lfn =['21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_', + '21jan11_TARG4_gcp__step_1_RLhebbwt_0_'] +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn,skipscore=True,skipfollow=True) + +performance saved as 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_5positions_perf.png (performance dropped when position changed.) + +----------------------- +.....now try second best..... + +cp backupcfg/21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_sim.json simFull.json + +original was + "yball": 80, + "yracket": 40, + +-- run sim 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_ (Jan20) + + "yball": 100, + "yracket": 20, + "name": "21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_", + +-- run sim 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_ (Jan20) + + "yball": 120, + "yracket": 10, + "name": "21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_", + +-- run sim 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_ (Jan20) + + "yball": 10, + "yracket": 120, + "name": "21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_", + + +-- run sim 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_ (Jan20) + + "yball": 20, + "yracket": 100, + "name": "21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_", + +-- run sim "21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_ (Jan20) + + "yball": 40, + "yracket": 80, + "name": ""21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_", + + +>>> lfn =['21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_','21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_'] +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn,skipscore=True,skipfollow=True) + +saved perf as 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_5positions_perf.png + +----------------------- +.....now try with initial weights..... + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p0_ + "yball": 80, + "yracket": 40, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p0_", + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p1_ + "yball": 100, + "yracket": 20, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p1_", + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p2_ + "yball": 120, + "yracket": 10, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p2_", + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p3_ + "yball": 10, + "yracket": 120, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p3_", + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p4_ + "yball": 20, + "yracket": 100, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p4_", + +-- run sim 21jan21_TARG4_gcp_RLhebbwt_0_p5_ + "yball": 40, + "yracket": 80, + "ResumeSim": 0 + "name": "21jan21_TARG4_gcp_RLhebbwt_0_p5_", + +>>> lfn =['21jan21_TARG4_gcp_RLhebbwt_0_p1_','21jan21_TARG4_gcp_RLhebbwt_0_p2_','21jan21_TARG4_gcp_RLhebbwt_0_p3_','21jan21_TARG4_gcp_RLhebbwt_0_p4_','21jan21_TARG4_gcp_RLhebbwt_0_p5_','21jan21_TARG4_gcp_RLhebbwt_0_p0_'] +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn,skipscore=True,skipfollow=True) +Saved performance comparison for 5 different initial positions in 21jan21_TARG4_gcp_RLhebbwt_0_5positions_perf.png (Jan22) + +--(Jan22) analyze performance (input sequence/ ball trajectory wise) + +>>> lfn0 =['21jan21_TARG4_gcp_RLhebbwt_0_p1_', + '21jan21_TARG4_gcp_RLhebbwt_0_p2_', + '21jan21_TARG4_gcp_RLhebbwt_0_p3_', + '21jan21_TARG4_gcp_RLhebbwt_0_p4_', + '21jan21_TARG4_gcp_RLhebbwt_0_p5_', + '21jan21_TARG4_gcp_RLhebbwt_0_p0_'] + +>>> pdimg0 = getconcatactioninputs(lfn0) +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p4_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p5_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p0_InputImages.txt + +>>> pda0 = getconcatactionreward(lfn0) + +>>> lSimilarSeqs0, seqs2plot0, seqBegs0, seqEnds_wrtRewards0 = breakdownPerformance(pdimg0,pda0,cend=69,sthresh=2) + +>>> len(seqs2plot0) +35 + +>>> displayPerformaceBreakdown(pdimg0,pda0,seqs2plot0[0:18],lSimilarSeqs0,seqBegs0,seqEnds_wrtRewards0) +saved as 21jan21_TARG4_gcp_RLhebbwt_0_5positions_seqbasedperf0.png +>>> displayPerformaceBreakdown(pdimg0,pda0,seqs2plot0[18:36],lSimilarSeqs0,seqBegs0,seqEnds_wrtRewards0) +saved as 21jan21_TARG4_gcp_RLhebbwt_0_5positions_seqbasedperf1.png + +>>> repsVsPerf0 = [] +>>> for reps in lSimilarSeqs0: +... hits = 0 +... misses = 0 +... if len(reps)>0: +... for rep in reps: +... if list(pda0['hit'])[seqEnds_wrtRewards0[rep]]>0: +... hits+=1 +... elif list(pda0['hit'])[seqEnds_wrtRewards0[rep]]<0: +... misses+=1 +... else: +... print('something wrong') +... repsVsPerf0.append([len(reps),hits,misses]) + + +>>> repsVsPerf0 = np.array(repsVsPerf0) +>>> plt.plot(repsVsPerf0[:,0],np.divide(repsVsPerf0[:,1],repsVsPerf0[:,0]),'bo') +[] +>>> xlabel('# of repeats [ball trajectory]') +Text(0.5,19.5222,'# of repeats [ball trajectory]') +>>> ylabel('Hits/[Hits+Miss]') +Text(38.3472,0.5,'Hits/[Hits+Miss]') + +saved as 21jan21_TARG4_gcp_RLhebbwt_0_5positions_repsVsPerf.png + +>>> lfn1 =['21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_', + '21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_', + '21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_', + '21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_', + '21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_', + '21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_'] + +>>> pdimg1 = getconcatactioninputs(lfn1) +loading input images from data/21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_InputImages.txt +loading input images from data/21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_InputImages.txt +loading input images from data/21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_InputImages.txt + +>>> pda1 = getconcatactionreward(lfn1) + +>>> lSimilarSeqs1, seqs2plot1, seqBegs1, seqEnds_wrtRewards1 = breakdownPerformance(pdimg1,pda1,cend=69,sthresh=2) +>>> len(seqs2plot1) +31 + +>>> displayPerformaceBreakdown(pdimg1,pda1,seqs2plot1[0:18],lSimilarSeqs1,seqBegs1,seqEnds_wrtRewards1) +saved as 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_5positions_seqbasedperf0.png + +>>> displayPerformaceBreakdown(pdimg1,pda1,seqs2plot1[18:32],lSimilarSeqs1,seqBegs1,seqEnds_wrtRewards1) +saved as 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_5positions_seqbasedperf1.png + +>>> repsVsPerf1 = [] +>>> for reps in lSimilarSeqs1: +... hits = 0 +... misses = 0 +... if len(reps)>0: +... for rep in reps: +... if list(pda1['hit'])[seqEnds_wrtRewards1[rep]]>0: +... hits+=1 +... elif list(pda1['hit'])[seqEnds_wrtRewards1[rep]]<0: +... misses+=1 +... else: +... print('something wrong') +... repsVsPerf1.append([len(reps),hits,misses]) +... +>>> repsVsPerf1 = np.array(repsVsPerf1) +>>> plt.plot(repsVsPerf1[:,0],np.divide(repsVsPerf1[:,1],repsVsPerf1[:,0]),'bo') +[] +>>> xlabel('# of repeats [ball trajectory]') +Text(0.5,19.5222,'# of repeats [ball trajectory]') +>>> ylabel('Hits/[Hits+Miss]') +Text(38.3472,0.5,'Hits/[Hits+Miss]') + +saved as 21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_5positions_repVsPerf.png + +>>> lfn2 =['21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_', + '21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_', + '21jan11_TARG4_gcp__step_1_RLhebbwt_0_'] + +>>> pdimg2 = getconcatactioninputs(lfn2) +loading input images from data/21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_InputImages.txt +loading input images from data/21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_1_RLhebbwt_0_InputImages.txt + +>>> pda2 = getconcatactionreward(lfn2) + +>>> lSimilarSeqs2, seqs2plot2, seqBegs2, seqEnds_wrtRewards2 = breakdownPerformance(pdimg2,pda2,cend=69,sthresh=2) +>>> len(seqs2plot2) + +>>> displayPerformaceBreakdown(pdimg2,pda2,seqs2plot2[0:18],lSimilarSeqs2,seqBegs2,seqEnds_wrtRewards2) +saved as 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_5positions_seqbasedperf0.png +>>> displayPerformaceBreakdown(pdimg2,pda2,seqs2plot2[18:34],lSimilarSeqs2,seqBegs2,seqEnds_wrtRewards2) +saved as 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_5positions_seqbasedperf1.png + +>>> repsVsPerf2 = [] +>>> for reps in lSimilarSeqs2: +... hits = 0 +... misses = 0 +... if len(reps)>0: +... for rep in reps: +... if list(pda2['hit'])[seqEnds_wrtRewards2[rep]]>0: +... hits+=1 +... elif list(pda2['hit'])[seqEnds_wrtRewards2[rep]]<0: +... misses+=1 +... else: +... print('something wrong') +... repsVsPerf2.append([len(reps),hits,misses]) +... +>>> repsVsPerf2 = np.array(repsVsPerf2) + +saved as 21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_5positions_repsVsPerf.png + +>>> lfnT = ['21jan6_TARG4_gcp__step_0_','21jan6_TARG4_gcp__step_1_','21jan6_TARG4_gcp__step_2_','21jan6_TARG4_gcp__step_3_','21jan6_TARG4_gcp__step_4_','21jan6_TARG4_gcp__step_5_','21jan6_TARG4_gcp__step_6_','21jan6_TARG4_gcp__step_7_','21jan6_TARG4_gcp__step_8_','21jan6_TARG4_gcp__step_9_','21jan6_TARG4_gcp__step_10_','21jan6_TARG4_gcp__step_11_','21jan6_TARG4_gcp__step_12_','21jan6_TARG4_gcp__step_13_','21jan6_TARG4_gcp__step_14_','21jan6_TARG4_gcp__step_15_','21jan6_TARG4_gcp__step_16_','21jan6_TARG4_gcp__step_17_','21jan6_TARG4_gcp__step_18_','21jan6_TARG4_gcp__step_19_','21jan11_TARG4_gcp__step_0_','21jan11_TARG4_gcp__step_1_','21jan11_TARG4_gcp__step_2_'] +>>> pdimgT = getconcatactioninputs(lfnT) +loading input images from data/21jan6_TARG4_gcp__step_0_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_1_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_2_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_3_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_4_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_5_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_6_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_7_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_8_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_9_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_10_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_11_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_12_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_13_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_14_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_15_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_16_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_17_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_18_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_19_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_0_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_1_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_2_InputImages.txt + +>>> pdaT = getconcatactionreward(lfnT) +>>> lSimilarSeqsT, seqs2plotT, seqBegsT, seqEnds_wrtRewardsT = breakdownPerformance(pdimgT,pdaT,cend=69,sthresh=5) +>>> len(seqs2plotT) +43 + +saved as 21jan22_21jan6_TARG4_gcp__allsteps_seqbasedperf0.png +>>> repsVsPerfT = [] +>>> for reps in lSimilarSeqsT: +... hits = 0 +... misses = 0 +... if len(reps)>0: +... for rep in reps: +... if list(pdaT['hit'])[seqEnds_wrtRewardsT[rep]]>0: +... hits+=1 +... elif list(pdaT['hit'])[seqEnds_wrtRewardsT[rep]]<0: +... misses+=1 +... else: +... print('something wrong') +... repsVsPerfT.append([len(reps),hits,misses]) +... +>>> repsVsPerfT = np.array(repsVsPerfT) + +>>> plt.plot(repsVsPerfT[:,0],np.divide(repsVsPerfT[:,1],repsVsPerfT[:,0]),'bo') +[] +>>> ylabel('Hits/[Hits+Miss]') +Text(38.3472,0.5,'Hits/[Hits+Miss]') +>>> xlabel('# of repeats [ball trajectory]') +Text(0.5,19.5222,'# of repeats [ball trajectory]') +>>> plt.plot(repsVsPerf0[:,0],np.divide(repsVsPerf0[:,1],repsVsPerf0[:,0]),'ro') +[] +>>> plt.plot(repsVsPerf1[:,0],np.divide(repsVsPerf1[:,1],repsVsPerf1[:,0]),'go') +[] +>>> plt.plot(repsVsPerf2[:,0],np.divide(repsVsPerf2[:,1],repsVsPerf2[:,0]),'co') +[] +>>> legend(['During Learning','Before Learning','After Learning: WT1','After Learning: WT2']) + +saved as 21jan22_repsVsPerfSummary.png +----------------------- + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_sim.json simFull.json + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_B_gcp__step_2_synWeights_final.pkl" + + "name": "21jan11_TARG4_B_gcp__step_2_RLhebbwt_0_", + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + + +(Jan13): saved comparing performances using different weight matrices: 21jan12_21jan11_TARG4_B_gcp__steps_2and3_RLhebbwt_0__compareperf.png + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan11_TARG4_B_gcp__step_2_RLhebbwt_0_sim.json simFull.json + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_B_gcp__step_1_synWeights_final.pkl" + "name": "21jan11_TARG4_B_gcp__step_1_RLhebbwt_0_" + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + +(Jan13): saved comparing performances using different weight matrices: 21jan12_21jan11_TARG4_B_gcp__steps_1and2and3_RLhebbwt_0__compareperf.png + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan11_TARG4_B_gcp__step_1_RLhebbwt_0_sim.json simFull.json + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_B_gcp__step_0_synWeights_final.pkl" + "name": "21jan11_TARG4_B_gcp__step_0_RLhebbwt_0_", + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan11_TARG4_B_gcp__step_1_RLhebbwt_0_sim.json simFull.json + + "ResumeSim": 1, + "ResumeSimFromFile": "/home/samn/SMARTAgent/data/21jan11_TARG4_B_gcp__step_4_synWeights_final.pkl" + "name": "21jan11_TARG4_B_gcp__step_4_RLhebbwt_0_", + +(Jan13): (base) hanwar@cycle:~/GamesProject/SMARTAgent$ mpiexec -n 30 nrniv -python -mpi sim.py simFull.json + +(Jan14): +>>> lfn =['21jan11_TARG4_B_gcp__step_0_RLhebbwt_0_', + '21jan11_TARG4_B_gcp__step_1_RLhebbwt_0_', + '21jan11_TARG4_B_gcp__step_2_RLhebbwt_0_', + '21jan11_TARG4_B_gcp__step_3_RLhebbwt_0_', + '21jan11_TARG4_B_gcp__step_4_RLhebbwt_0_'] +>>> lpda = getindivactionreward(lfn) +plotComparePerf(lpda,lclr=['r','b','g','c','m'],yl=(0,2),lleg=lfn) + +comparing controls: 21jan14_21jan11_TARG4_B_gcp__steps_0to4_RLhebbwt_0__compareperf.png + +21jan14_21jan11_TARG4_B_gcp__steps_0to4_RLhebbwt_0__meanweights.png (shows that sim '21jan11_TARG4_B_gcp__step_4_RLhebbwt_0_' didn't upload weights properly) + +on checking the dir /home/samn/SMARTAgent/data/, I realized there was no step_4..... thats why it used initial weight values. +------------------------------------------- + +-- analyzing performance se1quence wise..... + +.... testing an example for full model + +>>> lfn = ['21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_'] +>>> pdimg = getconcatactioninputs (lfn) +loading input images from data/21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_InputImages.txt +>>> pda = getconcatactionreward(lfn) +>>> lSimilarSeqs, seqs2plot, seqBegs, seqEnds_wrtRewards = breakdownPerformance(pdimg,pda,cend=69,sthresh=1) +>>> displayPerformaceBreakdown(pdimg, pda, seqs2plot[0:18], lSimilarSeqs,seqBegs,seqEnds_wrtRewards) + +.... testing an example for reduced model + +lfn = ['20dec17_B0_cycle_reduced_2obj_INTF7__step_0_','20dec17_B0_cycle_reduced_2obj_INTF7__step_1_','20dec17_B0_cycle_reduced_2obj_INTF7__step_2_','20dec17_B0_cycle_reduced_2obj_INTF7__step_3_'] +pdimg = getconcatactioninputs (lfn) +pda = getconcatactionreward(lfn) + +lSimilarSeqs, seqs2plot, seqBegs, seqEnds_wrtRewards = breakdownPerformance(pdimg,pda,cend=16, sthresh=2) +displayPerformaceBreakdown(pdimg, pda, seqs2plot[0:18], lSimilarSeqs,seqBegs,seqEnds_wrtRewards) + +------- +# ADDITIONAL ANALYSIS + +# plot performance as a function of repeats +# e.g. seq 1 repeated 20 times. gave 10 succesess and 10 failures (ratio = 0.5) +# seq 2 repeated 20 times, gave 5 successes and 15 failures. (ratio = 0.3) + +actreward = pda +repsVsPerf = [] +for reps in lSimilarSeqs: + hits = 0 + misses = 0 + if len(reps)>0: + for rep in reps: + if list(actreward['hit'])[seqEnds_wrtRewards[rep]]>0: + hits+=1 + elif list(actreward['hit'])[seqEnds_wrtRewards[rep]]<0: + misses+=1 + else: + print(reps) + print('something wrong') + repsVsPerf.append([len(reps),hits,misses]) + +repsVsPerf = np.array(repsVsPerf) +plt.plot(repsVsPerf[:,0],np.divide(repsVsPerf[:,1],repsVsPerf[:,2]),'o') +xlabel('# of repeats (ball trajectory)') +ylabel('Hit/Miss') + +# should incorporate this in simdat.py +----------- + + +-- (2021 Jan22) +"name": "21jan22_cycle_21jan11_falcor_RL3_F6_", same as + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 40 10 21jan22_RL3_cycle_multi + +run on falcor....... +21jan11_falcor_RL3_F6__step_0_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_1_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_2_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_3_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_4_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_5_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_6_synWeights_final.pkl +21jan11_falcor_RL3_F6__step_7_synWeights_final.pkl + + + +... analyzing sims output on (Jan25) + +>>> lfn = ['21jan22_cycle_21jan11_falcor_RL3_F6__step_0_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_1_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_2_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_3_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_4_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_5_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_6_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_7_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_8_', + '21jan22_cycle_21jan11_falcor_RL3_F6__step_9_'] +>>> pda = getconcatactionreward(lfn) +>>> plotPerf(pda) +saved perf as 21jan22_cycle_21jan11_falcor_RL3__steps0to9_Perf.png (Jan25) + +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr,yl=(0,2),lleg=lfn,skipscore=True,skipfollow=True) +saved perf as 21jan22_cycle_21jan11_falcor_RL3__steps0to9_comparePerf.png (Jan25) + +WHY THE PERFORMANCE OF SIMS ON FALCOR IS BETTER THAN PERFORMANCE OF SIMS ON CYCLE.. +....COMPARE THE PARAMS.....and sim.py. + +NOTE: copied all files from SMARTAgent/* to SMARTAgent_backupfor21jan11_falcor_RL3_F6/ just in case need to replicate the results. + +>>> pdfc = getconcatweightpdf(lfn) + +saved meanweights as 21jan22_cycle_21jan11_falcor_RL3__steps0to4_meanweights.png (Jan25) +saved meanweights as 21jan22_cycle_21jan11_falcor_RL3__steps5to9_meanweights.png (Jan25) + +>>> pdimg = getconcatactioninputs(lfn) +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_0_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_1_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_2_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_3_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_4_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_5_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_6_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_7_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_8_InputImages.txt +loading input images from data/21jan22_cycle_21jan11_falcor_RL3_F6__step_9_InputImages.txt + +>>> pda = getconcatactionreward(lfn) +>>> lSimilarSeqs, seqs2plot, seqBegs, seqEnds_wrtRewards = breakdownPerformance(pdimg,pda,cend=69,sthresh=5) + +>>> displayPerformaceBreakdown(pdimg,pda,seqs2plot[0:18],lSimilarSeqs,seqBegs,seqEnds_wrtRewards) +>>> displayPerformaceBreakdown(pdimg,pda,seqs2plot[18:36],lSimilarSeqs,seqBegs,seqEnds_wrtRewards) +>>> displayPerformaceBreakdown(pdimg,pda,seqs2plot[36:],lSimilarSeqs,seqBegs,seqEnds_wrtRewards) + +...... + +>>> lpda = getindivactionreward(lfn) +>>> plt.plot(lpda[0]['time'],np.cumsum(lpda[0]['hit'])) +[] +>>> plt.plot(lpda[1]['time'],np.cumsum(lpda[1]['hit'])) +[] +>>> plt.plot(lpda[2]['time'],np.cumsum(lpda[2]['hit'])) +[] +>>> plt.plot(lpda[3]['time'],np.cumsum(lpda[3]['hit'])) +[] +>>> plt.plot(lpda[4]['time'],np.cumsum(lpda[4]['hit'])) +[] +>>> plt.plot(lpda[5]['time'],np.cumsum(lpda[5]['hit'])) +[] +>>> plt.plot(lpda[6]['time'],np.cumsum(lpda[6]['hit'])) +[] +>>> plt.plot(lpda[7]['time'],np.cumsum(lpda[7]['hit'])) +[] +>>> plt.plot(lpda[8]['time'],np.cumsum(lpda[8]['hit'])) +[] +>>> plt.plot(lpda[9]['time'],np.cumsum(lpda[9]['hit'])) +[] + +saved as 21jan22_cycle_21jan11_falcor_RL3__cumHitMissed.png + +... may be need to quantify: +how many times the racket made a correct move which resulted in a HIT. +how many times the racket made a wrong move which resulted in a MISS. + +hit_seq_vs_good_bad_moves = [] + +for cSeqs in lSimilarSeqs: + cData = [] + if len(cSeqs)>0: + for cSeq in cSeqs: + cRewards = list(pda['reward'])[seqBegs[cSeq]:seqEnds_wrtRewards[cSeq]] + finalReward = list(pda['hit'])[seqEnds_wrtRewards[cSeq]] + cGoodMoves = len(np.where(np.array(cRewards)==0.1)[0]) + cBadMoves = len(np.where(np.array(cRewards)==-0.01)[0]) + cData.append([cSeq,cGoodMoves,cBadMoves,finalReward]) + hit_seq_vs_good_bad_moves.append(cData) + +..... + + +good_bad_moves = [] + +for cSeqs in lSimilarSeqs: + if len(cSeqs)>0: + for cSeq in cSeqs: + cRewards = list(pda['reward'])[seqBegs[cSeq]:seqEnds_wrtRewards[cSeq]] + finalReward = list(pda['hit'])[seqEnds_wrtRewards[cSeq]] + cGoodMoves = len(np.where(np.array(cRewards)==0.1)[0]) + cBadMoves = len(np.where(np.array(cRewards)==-0.01)[0]) + good_bad_moves.append([cGoodMoves,cBadMoves,finalReward]) + +------------------------------------ +-- resume for more steps (Jan25) + "ResumeSim": 1, + "ResumeSimFromFile": "data/21jan22_cycle_21jan11_falcor_RL3_F6__step_9_synWeights_final.pkl" + +"name": "21jan25_cycle_21jan11_falcor_RL3_F6_", +"targettedRL": 3 + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 40 10 21jan25_RL3_cycle_multi +...something wrong went here and the simulations failed. + + +-- (2021 Jan22) +"name": "21jan22_cycle_21jan11_falcor_RL1_F6_", +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 20 10 21jan22_RL1_cycle_multi + +>>> lfn2 = ['21jan22_cycle_21jan11_falcor_RL1_F6__step_5_','21jan22_cycle_21jan11_falcor_RL1_F6__step_6_','21jan22_cycle_21jan11_falcor_RL1_F6__step_7_','21jan22_cycle_21jan11_falcor_RL1_F6__step_8_','21jan22_cycle_21jan11_falcor_RL1_F6__step_9_'] +>>> lfn1 = ['21jan22_cycle_21jan11_falcor_RL1_F6__step_0_','21jan22_cycle_21jan11_falcor_RL1_F6__step_1_','21jan22_cycle_21jan11_falcor_RL1_F6__step_2_','21jan22_cycle_21jan11_falcor_RL1_F6__step_3_','21jan22_cycle_21jan11_falcor_RL1_F6__step_4_'] +>>> lfn = lfn1+lfn2 +>>> lfn +['21jan22_cycle_21jan11_falcor_RL1_F6__step_0_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_1_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_2_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_3_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_4_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_5_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_6_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_7_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_8_', '21jan22_cycle_21jan11_falcor_RL1_F6__step_9_'] + +.... some problem occured with saving _step_6 so step_7 was repeat of step_0 + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan22_cycle_21jan11_falcor_RL1_F6__step_6_sim.json simFullHA.json + "name": "21jan27_cycle_21jan11_falcor_RL1_F6_", + (base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 20 4 21jan27_RL1_cycle_multi + +----------------------------------------------------- +-- starting a new multistep sim..... (Jan27) + "losePoint": -0.05, (included this instead of 0) + "followTarget": 0.1, + "avoidTarget": -0.01, + "hitBall": 0.5 + +"name": "21jan27_cycle_RL3_F7_", + + "AMPA": { + "wbase": 2, + "wmax": 30, ---(increased from 20 to 30) + + python multistepSim.py simFullHA.json 30 10 21jan27_RL3_cycle_multi +sims COMPLETE +----- + +preparing figures for the paper.... + +Figure 1: (for simFullHA.json) + +python -i simdat.py backupcfg/21jan22_cycle_21jan11_falcor_RL3_F6__step_0_sim.json +>>> lfn1 = ['21jan22_cycle_21jan11_falcor_RL3_F6__step_0_','21jan22_cycle_21jan11_falcor_RL3_F6__step_1_','21jan22_cycle_21jan11_falcor_RL3_F6__step_2_','21jan22_cycle_21jan11_falcor_RL3_F6__step_3_','21jan22_cycle_21jan11_falcor_RL3_F6__step_4_'] +>>> lfn2 = ['21jan22_cycle_21jan11_falcor_RL3_F6__step_5_','21jan22_cycle_21jan11_falcor_RL3_F6__step_6_','21jan22_cycle_21jan11_falcor_RL3_F6__step_7_','21jan22_cycle_21jan11_falcor_RL3_F6__step_8_','21jan22_cycle_21jan11_falcor_RL3_F6__step_9_'] +>>> lfn = lfn1+lfn2 + +Figure 1a. + +>>> lpda = getindivactionreward(lfn) +>>> csm = cm.ScalarMappable(cmap=cm.jet); csm.set_clim((0,1)); +>>> lclr = [csm.to_rgba(float(i)/len(lpda)) for i in range(len(lpda))] +>>> plotComparePerf(lpda,lclr=yl=(0,2),lleg=['step_0','step_1','step_2','step_3','step_4','step_5','step_6','step_8','step_9'],skipscore=True,skipfollow=True) +save as 21jan27_Figure1a.eps +save as 21jan27_Figure1a.png + + +... for weights + +w0_all = readinweights(lfn[0],final=False) + +w0_t0 = w0_all[w0_all.time==np.min(w0_all.time)] +w0 = readinweights(lfn[0],final=True) +w1 = readinweights(lfn[1],final=True) +w2 = readinweights(lfn[2],final=True) +w3 = readinweights(lfn[3],final=True) +w4 = readinweights(lfn[4],final=True) +w5 = readinweights(lfn[5],final=True) +w6 = readinweights(lfn[6],final=True) +w7 = readinweights(lfn[7],final=True) +w8 = readinweights(lfn[8],final=True) +w9 = readinweights(lfn[9],final=True) + +>>> h0_t0 = np.histogram(w0_t0.weight,bins=range(21)) +>>> h0 = np.histogram(w0.weight,bins=range(21)) +>>> h1 = np.histogram(w1.weight,bins=range(21)) +>>> h2 = np.histogram(w2.weight,bins=range(21)) +>>> h3 = np.histogram(w3.weight,bins=range(21)) +>>> h4 = np.histogram(w4.weight,bins=range(21)) +>>> h5 = np.histogram(w5.weight,bins=range(21)) +>>> h6 = np.histogram(w6.weight,bins=range(21)) +>>> h7 = np.histogram(w7.weight,bins=range(21)) +>>> h8 = np.histogram(w8.weight,bins=range(21)) +>>> h9 = np.histogram(w9.weight,bins=range(21)) + +plt.plot(100*np.cumsum(np.divide(h0_t0[0],np.sum(h0_t0[0]))),'k') + +>>> plt.plot(100*np.cumsum(np.divide(h0[0],np.sum(h0[0]))),color=lclr[0]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h1[0],np.sum(h1[0]))),color=lclr[1]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h2[0],np.sum(h2[0]))),color=lclr[2]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h3[0],np.sum(h3[0]))),color=lclr[3]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h4[0],np.sum(h4[0]))),color=lclr[4]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h5[0],np.sum(h5[0]))),color=lclr[5]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h6[0],np.sum(h6[0]))),color=lclr[6]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h7[0],np.sum(h7[0]))),color=lclr[7]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h8[0],np.sum(h8[0]))),color=lclr[8]) +[] +>>> plt.plot(100*np.cumsum(np.divide(h9[0],np.sum(h9[0]))),color=lclr[9]) +[] + +....didnt save these plots because didnt show anything useful..... + +... (may be:) + +totalInputW0 = [] +for postid in np.unique(w0.postid): + totalInputW0.append([postid,np.sum(w0[w0.postid==postid].weight)]) + + + +>>> diff0 = np.subtract(w0,w0_t0) +>>> diff1 = np.subtract(w1,w0) +>>> diff2 = np.subtract(w2,w1) +>>> diff3 = np.subtract(w3,w2) +>>> diff4 = np.subtract(w4,w3) + +>>> h0 = np.histogram(diff0[:,3]) +>>> h1 = np.histogram(np.array(diff1)[:,3]) +>>> h2 = np.histogram(np.array(diff2)[:,3]) +>>> h3 = np.histogram(np.array(diff3)[:,3]) +>>> h4 = np.histogram(np.array(diff4)[:,3]) + +.... some potential plots for analysis.... +1. Distribution of deltaW, deltaW_post and deltaFR with training. +2. Distribution of W, W_post and FR with training. +3. Variance of each W, W_post across training +4. Variance of each neuron FR. + +... since "recordWeightStepSize": 200, for now look at firing rates in windows of 200 sec. + + +tpnts = np.unique(w0_all) +neuronID_EMUP = np.unique(dspkID['EMUP']) +neuronID_EMDOWN = np.unique(dspkID['EMDOWN']) + +# at each time point find NBspikes for each M neuron in preceeding interval. + +# Distribution of firing rates across training. + +fr_EMUP = np.zeros(shape=(len(tpnts),dnumc['EMUP'])) +fr_EMDOWN = np.zeros(shape=(len(tpnts),dnumc['EMDOWN'])) +for tind in range(len(tpnts)): + if tind==0: + t0 = 0 + else: + t0 = tpnts[tind-1] + tC = tpnts[tind] + counter1 = 0 + for neuronID in neuronID_EMUP: + cInds = np.where((dspkT['EMUP']>t0)&(dspkT['EMUP']<=tC)&(dspkID['EMUP']==neuronID)) + fr_EMUP[tind,counter1] = len(cInds[0]) + counter1+=1 + counter2 = 0 + for neuronID in neuronID_EMDOWN: + cInds = np.where((dspkT['EMDOWN']>t0)&(dspkT['EMDOWN']<=tC)&(dspkID['EMDOWN']==neuronID)) + fr_EMDOWN[tind,counter2] = len(cInds[0]) + counter2+=1 + +# distribution of deltaFR + +deltaFR_EMDOWN = np.subtract(fr_EMDOWN[2:,:],fr_EMDOWN[1:-1,:]) +deltaFR_EMUP = np.subtract(fr_EMUP[2:,:],fr_EMUP[1:-1,:]) + +# variance of firing rates of each neuron across training + +fr_EMUPvar = np.var(fr_EMUP,0) +fr_EMDOWNvar = np.var(fr_EMDOWN,0) + +# correlation +fr_EMUPcorrs = np.corrcoef(fr_EMUP.T) +fr_EMDOWNcorrs = np.corrcoef(fr_EMDOWN.T) + +fr_EMUPcorrs_l = [] +fr_EMDOWNcorrs_l = [] +for i in range(fr_EMUPcorrs.shape[0]): + for j in range(i+1,fr_EMUPcorrs.shape[0]): + fr_EMUPcorrs_l.append(fr_EMUPcorrs[i,j]) + fr_EMDOWNcorrs_l.append(fr_EMDOWNcorrs[i,j]) + + + +---------- + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python -i simdat.py backupcfg/21jan6_TARG4_gcp__step_0_sim.json + +>>> tpnts = np.unique(pdf.time) +>>> tpnts.shape +(50,) + + +# load performance of sims at the end of each repeat of Training + +>>> lfnT = ['21jan6_TARG4_gcp__step_0_', + '21jan6_TARG4_gcp__step_1_', + '21jan6_TARG4_gcp__step_2_', + '21jan6_TARG4_gcp__step_3_', + '21jan6_TARG4_gcp__step_4_', + '21jan6_TARG4_gcp__step_5_', + '21jan6_TARG4_gcp__step_6_', + '21jan6_TARG4_gcp__step_7_', + '21jan6_TARG4_gcp__step_8_', + '21jan6_TARG4_gcp__step_9_', + '21jan6_TARG4_gcp__step_10_', + '21jan6_TARG4_gcp__step_11_', + '21jan6_TARG4_gcp__step_12_', + '21jan6_TARG4_gcp__step_13_', + '21jan6_TARG4_gcp__step_14_', + '21jan6_TARG4_gcp__step_15_', + '21jan6_TARG4_gcp__step_16_', + '21jan6_TARG4_gcp__step_17_', + '21jan6_TARG4_gcp__step_18_', + '21jan6_TARG4_gcp__step_19_', + '21jan11_TARG4_gcp__step_0_', + '21jan11_TARG4_gcp__step_1_', + '21jan11_TARG4_gcp__step_2_'] + +lpdaT = getindivactionreward(lfnT) + +>>> hitVsMiss = [] +>>> for i in range(len(lpdaT)): +... hit = len(np.where(lpdaT[i]['hit']==1)[0]) +... miss = len(np.where(lpdaT[i]['hit']==-1)[0]) +... hitVsMiss.append([hit,miss]) + +>>> hitVsMiss = np.array(hitVsMiss) + +# load performance of sims After Training + +>>> lfnAT = ['21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_1_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_2_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_3_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_4_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_5_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_6_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_7_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_8_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_9_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_10_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_11_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_12_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_13_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_14_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_15_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_16_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_17_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_18_RLhebbwt_0_', + '21jan14_21jan6_TARG4_gcp__step_19_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_0_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_1_RLhebbwt_0_', + '21jan11_TARG4_gcp__step_2_RLhebbwt_0_'] + +>>> lpdaAT = getindivactionreward(lfnAT) + +>>> hitVsMissAT = [] +>>> for i in range(len(lpdaAT)): +... hit = len(np.where(lpdaAT[i]['hit']==1)[0]) +... miss = len(np.where(lpdaAT[i]['hit']==-1)[0]) +... hitVsMissAT.append([hit,miss]) +... +>>> hitVsMissAT = np.array(hitVsMissAT) + +# load performance after training for repeated positions +>>> lfnAT0 = ['21jan14_21jan6_TARG4_gcp__step_0_RLhebbwt_0_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p1_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p2_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p3_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p4_','21jan20_21jan6_TARG4_gcp__step_0_RLhebbwt_0_p5_'] +>>> lpdaAT0 = getindivactionreward(lfnAT0) + +>>> hitVsMissAT0 = [] +>>> for i in range(len(lpdaAT0)): +... hit = len(np.where(lpdaAT0[i]['hit']==1)[0]) +... miss = len(np.where(lpdaAT0[i]['hit']==-1)[0]) +... hitVsMissAT0.append([hit,miss]) +... +>>> hitVsMissAT0 = np.array(hitVsMissAT0) + + +>>> lfnAT21 = ['21jan11_TARG4_gcp__step_1_RLhebbwt_0_','21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p1_','21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p2_','21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p3_','21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p4_','21jan19_21jan11_TARG4_gcp__step_1_RLhebbwt_0_p5_'] +>>> lpdaAT21 = getindivactionreward(lfnAT21) + +>>> hitVsMissAT21 = [] +>>> for i in range(len(lpdaAT21)): +... hit = len(np.where(lpdaAT21[i]['hit']==1)[0]) +... miss = len(np.where(lpdaAT21[i]['hit']==-1)[0]) +... hitVsMissAT21.append([hit,miss]) +... +>>> hitVsMissAT21 = np.array(hitVsMissAT21) + + +# load performance of sims before Training + +>>> lfnBT = ['21jan21_TARG4_gcp_RLhebbwt_0_p0_', + '21jan21_TARG4_gcp_RLhebbwt_0_p1_', + '21jan21_TARG4_gcp_RLhebbwt_0_p2_', + '21jan21_TARG4_gcp_RLhebbwt_0_p3_', + '21jan21_TARG4_gcp_RLhebbwt_0_p4_', + '21jan21_TARG4_gcp_RLhebbwt_0_p5_'] + +>>> lpdaBT = getindivactionreward(lfnBT) +>>> hitVsMissBT = [] +>>> for i in range(len(lpdaBT)): +... hit = len(np.where(lpdaBT[i]['hit']==1)[0]) +... miss = len(np.where(lpdaBT[i]['hit']==-1)[0]) +... hitVsMissBT.append([hit,miss]) +... +>>> hitVsMissBT = np.array(hitVsMissBT) + + +bline = (hitVsMissBT[0,0]/hitVsMissBT[0,1])*np.ones(shape=(23,)) +>>> plt.plot(bline,'g--') +>>> plt.plot(np.divide(hitVsMiss[:,0],hitVsMiss[:,1]),'b-o') +[] +>>> plt.plot(np.divide(hitVsMissAT[:,0],hitVsMissAT[:,1]),'r--o') +[] + +>>> plt.legend(('Before training','During Training', 'After Training')) + +>>> xlabel('# of repeats') +Text(0.5,19.5222,'# of repeats') +>>> ylabel('Hit/Miss') +Text(38.3472,0.5,'Hit/Miss') + +saved as 21jan28_PerformanceSummaryFigure1_FullSam.png + +>>> w0_BT = readinweights(lfnBT[0],final=False) +w0_BT0 = w0_BT[(w0_BT.time==np.amin(w0_BT.time))] + +>>> w0 = readinweights(lfnT[0],final=True) +>>> w1 = readinweights(lfnT[1],final=True) +>>> w2 = readinweights(lfnT[2],final=True) +>>> w3 = readinweights(lfnT[3],final=True) +>>> w4 = readinweights(lfnT[4],final=True) +>>> w5 = readinweights(lfnT[5],final=True) +>>> w6 = readinweights(lfnT[6],final=True) +>>> w7 = readinweights(lfnT[7],final=True) +>>> w8 = readinweights(lfnT[8],final=True) +>>> w9 = readinweights(lfnT[9],final=True) +>>> w10 = readinweights(lfnT[10],final=True) +>>> w11 = readinweights(lfnT[11],final=True) +>>> w12 = readinweights(lfnT[12],final=True) +>>> w13 = readinweights(lfnT[13],final=True) +>>> w14 = readinweights(lfnT[14],final=True) +>>> w15 = readinweights(lfnT[15],final=True) +>>> w16 = readinweights(lfnT[16],final=True) +>>> w17 = readinweights(lfnT[17],final=True) +>>> w18 = readinweights(lfnT[18],final=True) +>>> w19 = readinweights(lfnT[19],final=True) +>>> w20 = readinweights(lfnT[20],final=True) +>>> w21 = readinweights(lfnT[21],final=True) +>>> w22 = readinweights(lfnT[22],final=True) + +>>> w0_BT0_EMUP = w0_BT0[(w0_BT0.postid>=dstartidx['EMUP'])&(w0_BT0.postid<=dendidx['EMUP'])] +>>> w0_BT0_EMDOWN = w0_BT0[(w0_BT0.postid>=dstartidx['EMDOWN'])&(w0_BT0.postid<=dendidx['EMDOWN'])] +>>> w0_BT0_EA = w0_BT0[(w0_BT0.postid>=dstartidx['EA'])&(w0_BT0.postid<=dendidx['EA'])] +>>> w0_BT0_EA2 = w0_BT0[(w0_BT0.postid>=dstartidx['EA2'])&(w0_BT0.postid<=dendidx['EA2'])] + + +w0_EMUP = w0[(w0.postid>=dstartidx['EMUP'])&(w0.postid<=dendidx['EMUP'])] +w0_EMDOWN = w0[(w0.postid>=dstartidx['EMDOWN'])&(w0.postid<=dendidx['EMDOWN'])] +w0_EA = w0[(w0.postid>=dstartidx['EA'])&(w0.postid<=dendidx['EA'])] +w0_EA2 = w0[(w0.postid>=dstartidx['EA2'])&(w0.postid<=dendidx['EA2'])] + +>>> w1_EMUP = w1[(w1.postid>=dstartidx['EMUP'])&(w1.postid<=dendidx['EMUP'])] +>>> w1_EMDOWN = w1[(w1.postid>=dstartidx['EMDOWN'])&(w1.postid<=dendidx['EMDOWN'])] +>>> w1_EA = w1[(w1.postid>=dstartidx['EA'])&(w1.postid<=dendidx['EA'])] +>>> w1_EA2 = w1[(w1.postid>=dstartidx['EA2'])&(w1.postid<=dendidx['EA2'])] + +>>> w2_EMUP = w2[(w2.postid>=dstartidx['EMUP'])&(w2.postid<=dendidx['EMUP'])] +>>> w2_EMDOWN = w2[(w2.postid>=dstartidx['EMDOWN'])&(w2.postid<=dendidx['EMDOWN'])] +>>> w2_EA = w2[(w2.postid>=dstartidx['EA'])&(w2.postid<=dendidx['EA'])] +>>> w2_EA2 = w2[(w2.postid>=dstartidx['EA2'])&(w2.postid<=dendidx['EA2'])] + +>>> w3_EMUP = w3[(w3.postid>=dstartidx['EMUP'])&(w3.postid<=dendidx['EMUP'])] +>>> w3_EMDOWN = w3[(w3.postid>=dstartidx['EMDOWN'])&(w3.postid<=dendidx['EMDOWN'])] +>>> w3_EA = w3[(w3.postid>=dstartidx['EA'])&(w3.postid<=dendidx['EA'])] +>>> w3_EA2 = w3[(w3.postid>=dstartidx['EA2'])&(w3.postid<=dendidx['EA2'])] + +>>> w4_EMUP = w4[(w4.postid>=dstartidx['EMUP'])&(w4.postid<=dendidx['EMUP'])] +>>> w4_EMDOWN = w4[(w4.postid>=dstartidx['EMDOWN'])&(w4.postid<=dendidx['EMDOWN'])] +>>> w4_EA = w4[(w4.postid>=dstartidx['EA'])&(w4.postid<=dendidx['EA'])] +>>> w4_EA2 = w4[(w4.postid>=dstartidx['EA2'])&(w4.postid<=dendidx['EA2'])] + +>>> w5_EMUP = w5[(w5.postid>=dstartidx['EMUP'])&(w5.postid<=dendidx['EMUP'])] +>>> w5_EMDOWN = w5[(w5.postid>=dstartidx['EMDOWN'])&(w5.postid<=dendidx['EMDOWN'])] +>>> w5_EA = w5[(w5.postid>=dstartidx['EA'])&(w5.postid<=dendidx['EA'])] +>>> w5_EA2 = w5[(w5.postid>=dstartidx['EA2'])&(w5.postid<=dendidx['EA2'])] + +>>> w6_EMUP = w6[(w6.postid>=dstartidx['EMUP'])&(w6.postid<=dendidx['EMUP'])] +>>> w6_EMDOWN = w6[(w6.postid>=dstartidx['EMDOWN'])&(w6.postid<=dendidx['EMDOWN'])] +>>> w6_EA = w6[(w6.postid>=dstartidx['EA'])&(w6.postid<=dendidx['EA'])] +>>> w6_EA2 = w6[(w6.postid>=dstartidx['EA2'])&(w6.postid<=dendidx['EA2'])] + +>>> w7_EMUP = w7[(w7.postid>=dstartidx['EMUP'])&(w7.postid<=dendidx['EMUP'])] +>>> w7_EMDOWN = w7[(w7.postid>=dstartidx['EMDOWN'])&(w7.postid<=dendidx['EMDOWN'])] +>>> w7_EA = w7[(w7.postid>=dstartidx['EA'])&(w7.postid<=dendidx['EA'])] +>>> w7_EA2 = w7[(w7.postid>=dstartidx['EA2'])&(w7.postid<=dendidx['EA2'])] + +>>> w8_EMUP = w8[(w8.postid>=dstartidx['EMUP'])&(w8.postid<=dendidx['EMUP'])] +>>> w8_EMDOWN = w8[(w8.postid>=dstartidx['EMDOWN'])&(w8.postid<=dendidx['EMDOWN'])] +>>> w8_EA = w8[(w8.postid>=dstartidx['EA'])&(w8.postid<=dendidx['EA'])] +>>> w8_EA2 = w8[(w8.postid>=dstartidx['EA2'])&(w8.postid<=dendidx['EA2'])] + +>>> w9_EMUP = w9[(w9.postid>=dstartidx['EMUP'])&(w9.postid<=dendidx['EMUP'])] +>>> w9_EMDOWN = w9[(w9.postid>=dstartidx['EMDOWN'])&(w9.postid<=dendidx['EMDOWN'])] +>>> w9_EA = w9[(w9.postid>=dstartidx['EA'])&(w9.postid<=dendidx['EA'])] +>>> w9_EA2 = w9[(w9.postid>=dstartidx['EA2'])&(w9.postid<=dendidx['EA2'])] + +>>> w10_EMUP = w10[(w10.postid>=dstartidx['EMUP'])&(w10.postid<=dendidx['EMUP'])] +>>> w10_EMDOWN = w10[(w10.postid>=dstartidx['EMDOWN'])&(w10.postid<=dendidx['EMDOWN'])] +>>> w10_EA = w10[(w10.postid>=dstartidx['EA'])&(w10.postid<=dendidx['EA'])] +>>> w10_EA2 = w10[(w10.postid>=dstartidx['EA2'])&(w10.postid<=dendidx['EA2'])] + +>>> w11_EMUP = w11[(w11.postid>=dstartidx['EMUP'])&(w11.postid<=dendidx['EMUP'])] +>>> w11_EMDOWN = w11[(w11.postid>=dstartidx['EMDOWN'])&(w11.postid<=dendidx['EMDOWN'])] +>>> w11_EA = w11[(w11.postid>=dstartidx['EA'])&(w11.postid<=dendidx['EA'])] +>>> w11_EA2 = w11[(w11.postid>=dstartidx['EA2'])&(w11.postid<=dendidx['EA2'])] + +>>> w12_EMUP = w12[(w12.postid>=dstartidx['EMUP'])&(w12.postid<=dendidx['EMUP'])] +>>> w12_EMDOWN = w12[(w12.postid>=dstartidx['EMDOWN'])&(w12.postid<=dendidx['EMDOWN'])] +>>> w12_EA = w12[(w12.postid>=dstartidx['EA'])&(w12.postid<=dendidx['EA'])] +>>> w12_EA2 = w12[(w12.postid>=dstartidx['EA2'])&(w12.postid<=dendidx['EA2'])] + +>>> w13_EMUP = w13[(w13.postid>=dstartidx['EMUP'])&(w13.postid<=dendidx['EMUP'])] +>>> w13_EMDOWN = w13[(w13.postid>=dstartidx['EMDOWN'])&(w13.postid<=dendidx['EMDOWN'])] +>>> w13_EA = w13[(w13.postid>=dstartidx['EA'])&(w13.postid<=dendidx['EA'])] +>>> w13_EA2 = w13[(w13.postid>=dstartidx['EA2'])&(w13.postid<=dendidx['EA2'])] + +>>> w14_EMUP = w14[(w14.postid>=dstartidx['EMUP'])&(w14.postid<=dendidx['EMUP'])] +>>> w14_EMDOWN = w14[(w14.postid>=dstartidx['EMDOWN'])&(w14.postid<=dendidx['EMDOWN'])] +>>> w14_EA = w14[(w14.postid>=dstartidx['EA'])&(w14.postid<=dendidx['EA'])] +>>> w14_EA2 = w14[(w14.postid>=dstartidx['EA2'])&(w14.postid<=dendidx['EA2'])] + +>>> w15_EMUP = w15[(w15.postid>=dstartidx['EMUP'])&(w15.postid<=dendidx['EMUP'])] +>>> w15_EMDOWN = w15[(w15.postid>=dstartidx['EMDOWN'])&(w15.postid<=dendidx['EMDOWN'])] +>>> w15_EA = w15[(w15.postid>=dstartidx['EA'])&(w15.postid<=dendidx['EA'])] +>>> w15_EA2 = w15[(w15.postid>=dstartidx['EA2'])&(w15.postid<=dendidx['EA2'])] + +>>> w16_EMUP = w16[(w16.postid>=dstartidx['EMUP'])&(w16.postid<=dendidx['EMUP'])] +>>> w16_EMDOWN = w16[(w16.postid>=dstartidx['EMDOWN'])&(w16.postid<=dendidx['EMDOWN'])] +>>> w16_EA = w16[(w16.postid>=dstartidx['EA'])&(w16.postid<=dendidx['EA'])] +>>> w16_EA2 = w16[(w16.postid>=dstartidx['EA2'])&(w16.postid<=dendidx['EA2'])] + +>>> w17_EMUP = w17[(w17.postid>=dstartidx['EMUP'])&(w17.postid<=dendidx['EMUP'])] +>>> w17_EMDOWN = w17[(w17.postid>=dstartidx['EMDOWN'])&(w17.postid<=dendidx['EMDOWN'])] +>>> w17_EA = w17[(w17.postid>=dstartidx['EA'])&(w17.postid<=dendidx['EA'])] +>>> w17_EA2 = w17[(w17.postid>=dstartidx['EA2'])&(w17.postid<=dendidx['EA2'])] + +>>> w18_EMUP = w18[(w18.postid>=dstartidx['EMUP'])&(w18.postid<=dendidx['EMUP'])] +>>> w18_EMDOWN = w18[(w18.postid>=dstartidx['EMDOWN'])&(w18.postid<=dendidx['EMDOWN'])] +>>> w18_EA = w18[(w18.postid>=dstartidx['EA'])&(w18.postid<=dendidx['EA'])] +>>> w18_EA2 = w18[(w18.postid>=dstartidx['EA2'])&(w18.postid<=dendidx['EA2'])] + +>>> w19_EMUP = w19[(w19.postid>=dstartidx['EMUP'])&(w19.postid<=dendidx['EMUP'])] +>>> w19_EMDOWN = w19[(w19.postid>=dstartidx['EMDOWN'])&(w19.postid<=dendidx['EMDOWN'])] +>>> w19_EA = w19[(w19.postid>=dstartidx['EA'])&(w19.postid<=dendidx['EA'])] +>>> w19_EA2 = w19[(w19.postid>=dstartidx['EA2'])&(w19.postid<=dendidx['EA2'])] + +>>> w20_EMUP = w20[(w20.postid>=dstartidx['EMUP'])&(w20.postid<=dendidx['EMUP'])] +>>> w20_EMDOWN = w20[(w20.postid>=dstartidx['EMDOWN'])&(w20.postid<=dendidx['EMDOWN'])] +>>> w20_EA = w20[(w20.postid>=dstartidx['EA'])&(w20.postid<=dendidx['EA'])] +>>> w20_EA2 = w20[(w20.postid>=dstartidx['EA2'])&(w20.postid<=dendidx['EA2'])] + +>>> w21_EMUP = w21[(w21.postid>=dstartidx['EMUP'])&(w21.postid<=dendidx['EMUP'])] +>>> w21_EMDOWN = w21[(w21.postid>=dstartidx['EMDOWN'])&(w21.postid<=dendidx['EMDOWN'])] +>>> w21_EA = w21[(w21.postid>=dstartidx['EA'])&(w21.postid<=dendidx['EA'])] +>>> w21_EA2 = w21[(w21.postid>=dstartidx['EA2'])&(w21.postid<=dendidx['EA2'])] + +>>> w22_EMUP = w22[(w22.postid>=dstartidx['EMUP'])&(w22.postid<=dendidx['EMUP'])] +>>> w22_EMDOWN = w22[(w22.postid>=dstartidx['EMDOWN'])&(w22.postid<=dendidx['EMDOWN'])] +>>> w22_EA = w22[(w22.postid>=dstartidx['EA'])&(w22.postid<=dendidx['EA'])] +>>> w22_EA2 = w22[(w22.postid>=dstartidx['EA2'])&(w22.postid<=dendidx['EA2'])] + +# check if these weights change.... +>>> w22_IA = w22[(w22.postid>=dstartidx['IA'])&(w22.postid<=dendidx['IA'])] +>>> w22_IAL = w22[(w22.postid>=dstartidx['IAL'])&(w22.postid<=dendidx['IAL'])] +>>> w22_IA2 = w22[(w22.postid>=dstartidx['IA2'])&(w22.postid<=dendidx['IA2'])] +>>> w22_IA2L = w22[(w22.postid>=dstartidx['IA2L'])&(w22.postid<=dendidx['IA2L'])] +>>> w22_IM = w22[(w22.postid>=dstartidx['IM'])&(w22.postid<=dendidx['IM'])] +>>> w22_IML = w22[(w22.postid>=dstartidx['IML'])&(w22.postid<=dendidx['IML'])] +>>> w0_IML = w0[(w0.postid>=dstartidx['IML'])&(w0.postid<=dendidx['IML'])] +>>> w0_IM = w0[(w0.postid>=dstartidx['IM'])&(w0.postid<=dendidx['IM'])] +>>> w0_IA = w0[(w0.postid>=dstartidx['IA'])&(w0.postid<=dendidx['IA'])] +>>> w0_IA2 = w0[(w0.postid>=dstartidx['IA2'])&(w0.postid<=dendidx['IA2'])] +>>> w0_IA2L = w0[(w0.postid>=dstartidx['IA2L'])&(w0.postid<=dendidx['IA2L'])] +>>> w0_IAL = w0[(w0.postid>=dstartidx['IAL'])&(w0.postid<=dendidx['IAL'])] +# these are empty.... Inhibitiory connections are not plastic. + + +>>> EA_boxwghts = [] # compute median, 25 percentile and 75 percentile +>>> EA_boxwghts.append(list(np.percentile(w0_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w1_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w2_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w3_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w4_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w5_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w6_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w7_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w8_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w9_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w10_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w11_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w12_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w13_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w14_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w15_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w16_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w17_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w18_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w19_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w20_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w21_EA['weight'],[25,50,75]))) +>>> EA_boxwghts.append(list(np.percentile(w22_EA['weight'],[25,50,75]))) + + +>>> plt.plot(EA_boxwghts[:,1],'-o',color='C0') +[] +>>> plt.plot(EA_boxwghts[:,0],'--',color='C0') +[] +>>> plt.plot(EA_boxwghts[:,2],'--',color='C0') +[] +>>> plt.legend(('Median','25/75 percentile')) + +>>> xlabel('# of repeats') +Text(0.5,19.5222,'# of repeats') +>>> ylabel('EA weights') + +... saved as 21jan28_EAweightsFigure1_FullSam.png + + +>>> plt.plot(EA2_boxwghts[:,0],'--',color='C1') +[] +>>> plt.plot(EA2_boxwghts[:,2],'--',color='C1') +[] +>>> plt.legend(('Median','25/75 percentile')) + +>>> ylabel('EA2 weights') +Text(38.4722,0.5,'EA2 weights') +>>> xlabel('# of repeats') +Text(0.5,19.5222,'# of repeats') + +... saved as 21jan28_EA2weightsFigure1_FullSam.png + +>>> plt.plot(EMUP_boxwghts[:,1],'-o',color='C2') +[] +>>> plt.plot(EMUP_boxwghts[:,0],'--',color='C2') +[] +>>> plt.plot(EMDOWN_boxwghts[:,1],'-o',color='C3') +[] +>>> plt.plot(EMDOWN_boxwghts[:,0],'--',color='C3') +[] +>>> plt.plot(EMUP_boxwghts[:,2],'--',color='C2') +[] +>>> plt.plot(EMDOWN_boxwghts[:,2],'--',color='C3') +[] +>>> plt.legend(('EMUP - Median','EMUP - 25/75 percentile','EMDOWN - Median','EMDOWN - 25/75 percentile')) + +>>> ylim((0.35,0.85)) +(0.35, 0.85) +>>> ylabel('EM weights') +Text(38.4722,0.5,'EM weights') +>>> xlabel('# of repeats') +Text(0.5,19.5222,'# of repeats') + +... saved as 21jan28_EMweightsFigure1_FullSam.png + + +# dig deep into weights w0 and w21 + +# recurrent conns +>>> w0_BT0_EMUP_rec = w0_BT0_EMUP[(w0_BT0_EMUP.preid>=dstartidx['EMUP'])&(w0_BT0_EMUP.preid<=dendidx['EMUP'])] +>>> w0_BT0_EMDOWN_rec = w0_BT0_EMDOWN[(w0_BT0_EMDOWN.preid>=dstartidx['EMDOWN'])&(w0_BT0_EMDOWN.preid<=dendidx['EMDOWN'])] + +>>> w0_EMUP_rec = w0_EMUP[(w0_EMUP.preid>=dstartidx['EMUP'])&(w0_EMUP.preid<=dendidx['EMUP'])] +>>> w0_EMDOWN_rec = w0_EMDOWN[(w0_EMDOWN.preid>=dstartidx['EMDOWN'])&(w0_EMDOWN.preid<=dendidx['EMDOWN'])] + +>>> w21_EMUP_rec = w21_EMUP[(w21_EMUP.preid>=dstartidx['EMUP'])&(w21_EMUP.preid<=dendidx['EMUP'])] +>>> w21_EMDOWN_rec = w21_EMDOWN[(w21_EMDOWN.preid>=dstartidx['EMDOWN'])&(w21_EMDOWN.preid<=dendidx['EMDOWN'])] + +# feedback conns to EA and EA2 + +>>> w0_BT0_EA_EMUP = w0_BT0_EA[(w0_BT0_EA.preid>=dstartidx['EMUP'])&(w0_BT0_EA.preid<=dendidx['EMUP'])] +>>> w0_BT0_EA_EMDOWN = w0_BT0_EA[(w0_BT0_EA.preid>=dstartidx['EMDOWN'])&(w0_BT0_EA.preid<=dendidx['EMDOWN'])] + +>>> w0_BT0_EA2_EMUP = w0_BT0_EA2[(w0_BT0_EA2.preid>=dstartidx['EMUP'])&(w0_BT0_EA2.preid<=dendidx['EMUP'])] +>>> w0_BT0_EA2_EMDOWN = w0_BT0_EA2[(w0_BT0_EA2.preid>=dstartidx['EMDOWN'])&(w0_BT0_EA2.preid<=dendidx['EMDOWN'])] + +>>> w0_EA_EMUP = w0_EA[(w0_EA.preid>=dstartidx['EMUP'])&(w0_EA.preid<=dendidx['EMUP'])] +>>> w0_EA2_EMUP = w0_EA2[(w0_EA2.preid>=dstartidx['EMUP'])&(w0_EA2.preid<=dendidx['EMUP'])] + +>>> w0_EA_EMDOWN = w0_EA[(w0_EA.preid>=dstartidx['EMDOWN'])&(w0_EA.preid<=dendidx['EMDOWN'])] +>>> w0_EA2_EMDOWN = w0_EA2[(w0_EA2.preid>=dstartidx['EMDOWN'])&(w0_EA2.preid<=dendidx['EMDOWN'])] + +>>> w21_EA_EMUP = w21_EA[(w21_EA.preid>=dstartidx['EMUP'])&(w21_EA.preid<=dendidx['EMUP'])] +>>> w21_EA2_EMUP = w21_EA2[(w21_EA2.preid>=dstartidx['EMUP'])&(w21_EA2.preid<=dendidx['EMUP'])] + +>>> w21_EA_EMDOWN = w21_EA[(w21_EA.preid>=dstartidx['EMDOWN'])&(w21_EA.preid<=dendidx['EMDOWN'])] +>>> w21_EA2_EMDOWN = w21_EA2[(w21_EA2.preid>=dstartidx['EMDOWN'])&(w21_EA2.preid<=dendidx['EMDOWN'])] + +# FF excitatory conns +>>> w0_BT0_EMUP_fromEA = w0_BT0_EMUP[(w0_BT0_EMUP.preid>=dstartidx['EA'])&(w0_BT0_EMUP.preid<=dendidx['EA'])] +>>> w0_BT0_EMUP_fromEA2 = w0_BT0_EMUP[(w0_BT0_EMUP.preid>=dstartidx['EA2'])&(w0_BT0_EMUP.preid<=dendidx['EA2'])] + +>>> w0_BT0_EMDOWN_fromEA = w0_BT0_EMDOWN[(w0_BT0_EMDOWN.preid>=dstartidx['EA'])&(w0_BT0_EMDOWN.preid<=dendidx['EA'])] +>>> w0_BT0_EMDOWN_fromEA2 = w0_BT0_EMDOWN[(w0_BT0_EMDOWN.preid>=dstartidx['EA2'])&(w0_BT0_EMDOWN.preid<=dendidx['EA2'])] + +>>> w0_EMUP_fromEA = w0_EMUP[(w0_EMUP.preid>=dstartidx['EA'])&(w0_EMUP.preid<=dendidx['EA'])] +>>> w0_EMUP_fromEA2 = w0_EMUP[(w0_EMUP.preid>=dstartidx['EA2'])&(w0_EMUP.preid<=dendidx['EA2'])] + +>>> w0_EMDOWN_fromEA = w0_EMDOWN[(w0_EMDOWN.preid>=dstartidx['EA'])&(w0_EMDOWN.preid<=dendidx['EA'])] +>>> w0_EMDOWN_fromEA2 = w0_EMDOWN[(w0_EMDOWN.preid>=dstartidx['EA2'])&(w0_EMDOWN.preid<=dendidx['EA2'])] + +>>> w21_EMUP_fromEA = w21_EMUP[(w21_EMUP.preid>=dstartidx['EA'])&(w21_EMUP.preid<=dendidx['EA'])] +>>> w21_EMUP_fromEA2 = w21_EMUP[(w21_EMUP.preid>=dstartidx['EA2'])&(w21_EMUP.preid<=dendidx['EA2'])] + +>>> w21_EMDOWN_fromEA = w21_EMDOWN[(w21_EMDOWN.preid>=dstartidx['EA'])&(w21_EMDOWN.preid<=dendidx['EA'])] +>>> w21_EMDOWN_fromEA2 = w21_EMDOWN[(w21_EMDOWN.preid>=dstartidx['EA2'])&(w21_EMDOWN.preid<=dendidx['EA2'])] + +####### + +w0_BT0_EMUP_fromEMDOWN = w0_BT0_EMUP[(w0_BT0_EMUP.preid>=dstartidx['EMDOWN'])&(w0_BT0_EMUP.preid<=dendidx['EMDOWN'])] +w0_BT0_EMDOWN_fromEMUP = w0_BT0_EMDOWN[(w0_BT0_EMDOWN.preid>=dstartidx['EMUP'])&(w0_BT0_EMDOWN.preid<=dendidx['EMUP'])] + +w0_EMUP_fromEMDOWN = w0_EMUP[(w0_EMUP.preid>=dstartidx['EMDOWN'])&(w0_EMUP.preid<=dendidx['EMDOWN'])] +w0_EMDOWN_fromEMUP = w0_EMDOWN[(w0_EMDOWN.preid>=dstartidx['EMUP'])&(w0_EMDOWN.preid<=dendidx['EMUP'])] + +w21_EMUP_fromEMDOWN = w21_EMUP[(w21_EMUP.preid>=dstartidx['EMDOWN'])&(w21_EMUP.preid<=dendidx['EMDOWN'])] +w21_EMDOWN_fromEMUP = w21_EMDOWN[(w21_EMDOWN.preid>=dstartidx['EMUP'])&(w21_EMDOWN.preid<=dendidx['EMUP'])] + +# r1 = np.reshape(np.array(w0_EMDOWN_rec['weight']),(180,100)) +>>> w0_EMUP_rec['weight'].shape +(18000,) +>>> w0_EMDOWN_rec['weight'].shape +(18000,) +>>> w0_EMUP_fromEA['weight'].shape +(30000,) +>>> w0_EMUP_fromEA2['weight'].shape +(18000,) +>>> w0_EMDOWN_fromEA2['weight'].shape +(18000,) +>>> w0_EMDOWN_fromEA['weight'].shape +(30000,) +>>> w0_EMDOWN_fromEMUP['weight'].shape +(18000,) +>>> w0_EMUP_fromEMDOWN['weight'].shape +(18000,) + +# +>>> EMUPneuronIDs = np.unique(w0_BT0_EMUP_rec['postid']) +>>> EMDOWNneuronIDs = np.unique(w0_BT0_EMDOWN_rec['postid']) + +>>> EAneuronIDs = np.unique(w0_BT0_EA['postid']) +>>> EA2neuronIDs = np.unique(w0_BT0_EA2['postid']) + + +>>> EMUPrecW_t0 = np.zeros((dnumc['EMUP'],)) +>>> EMUPrecW_t1 = np.zeros((dnumc['EMUP'],)) +>>> EMUPrecW_t21 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA_t0 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA_t1 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA_t21 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA2_t0 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA2_t1 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EA2_t21 = np.zeros((dnumc['EMUP'],)) + +>>> EMDOWNrecW_t0 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNrecW_t1 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNrecW_t21 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA_t0 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA_t1 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA_t21 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA2_t0 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA2_t1 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EA2_t21 = np.zeros((dnumc['EMDOWN'],)) + +>>> counter = 0 +>>> EMDOWNneuronIDs = np.unique(w0_BT0_EMDOWN_rec['postid']) +>>> for cID in EMUPneuronIDs: +... EMUPrecW_t0[counter]=np.sum(w0_BT0_EMUP_rec[w0_BT0_EMUP_rec.postid==cID]['weight']) +... EMUPrecW_t1[counter]=np.sum(w0_EMUP_rec[w0_EMUP_rec.postid==cID]['weight']) +... EMUPrecW_t21[counter]=np.sum(w21_EMUP_rec[w21_EMUP_rec.postid==cID]['weight']) +... EMUPW_EA_t0[counter]=np.sum(w0_BT0_EMUP_fromEA[w0_BT0_EMUP_fromEA.postid==cID]['weight']) +... EMUPW_EA_t1[counter]=np.sum(w0_EMUP_fromEA[w0_EMUP_fromEA.postid==cID]['weight']) +... EMUPW_EA_t21[counter]=np.sum(w21_EMUP_fromEA[w21_EMUP_fromEA.postid==cID]['weight']) +... EMUPW_EA2_t0[counter]=np.sum(w0_BT0_EMUP_fromEA2[w0_BT0_EMUP_fromEA2.postid==cID]['weight']) +... EMUPW_EA2_t1[counter]=np.sum(w0_EMUP_fromEA2[w0_EMUP_fromEA2.postid==cID]['weight']) +... EMUPW_EA2_t21[counter]=np.sum(w21_EMUP_fromEA2[w21_EMUP_fromEA2.postid==cID]['weight']) +... counter+=1 +... +>>> counter = 0 +>>> for cID in EMDOWNneuronIDs: +... EMDOWNrecW_t0[counter]=np.sum(w0_BT0_EMDOWN_rec[w0_BT0_EMDOWN_rec.postid==cID]['weight']) +... EMDOWNrecW_t1[counter]=np.sum(w0_EMDOWN_rec[w0_EMDOWN_rec.postid==cID]['weight']) +... EMDOWNrecW_t21[counter]=np.sum(w21_EMDOWN_rec[w21_EMDOWN_rec.postid==cID]['weight']) +... EMDOWNW_EA_t0[counter]=np.sum(w0_BT0_EMDOWN_fromEA[w0_BT0_EMDOWN_fromEA.postid==cID]['weight']) +... EMDOWNW_EA_t1[counter]=np.sum(w0_EMDOWN_fromEA[w0_EMDOWN_fromEA.postid==cID]['weight']) +... EMDOWNW_EA_t21[counter]=np.sum(w21_EMDOWN_fromEA[w21_EMDOWN_fromEA.postid==cID]['weight']) +... EMDOWNW_EA2_t0[counter]=np.sum(w0_BT0_EMDOWN_fromEA2[w0_BT0_EMDOWN_fromEA2.postid==cID]['weight']) +... EMDOWNW_EA2_t1[counter]=np.sum(w0_EMDOWN_fromEA2[w0_EMDOWN_fromEA2.postid==cID]['weight']) +... EMDOWNW_EA2_t21[counter]=np.sum(w21_EMDOWN_fromEA2[w21_EMDOWN_fromEA2.postid==cID]['weight']) +... counter+=1 + + +>>> vmin1 = np.amin([np.amin(EMUPrecW_t0),np.amin(EMUPrecW_t1),np.amin(EMUPrecW_t21),np.amin(EMDOWNrecW_t0),np.amin(EMDOWNrecW_t1),np.amin(EMDOWNrecW_t21)]) +>>> vmax1 = np.amax([np.amax(EMUPrecW_t0),np.amax(EMUPrecW_t1),np.amax(EMUPrecW_t21),np.amax(EMDOWNrecW_t0),np.amax(EMDOWNrecW_t1),np.amax(EMDOWNrecW_t21)]) + +>>> vmin2 = np.amin([np.amin(EMUPW_EA_t0),np.amin(EMUPW_EA_t1),np.amin(EMUPW_EA_t21),np.amin(EMDOWNW_EA_t0),np.amin(EMDOWNW_EA_t1),np.amin(EMDOWNW_EA_t21)]) +>>> vmax2 = np.amax([np.amax(EMUPW_EA_t0),np.amax(EMUPW_EA_t1),np.amax(EMUPW_EA_t21),np.amax(EMDOWNW_EA_t0),np.amax(EMDOWNW_EA_t1),np.amax(EMDOWNW_EA_t21)]) + +>>> vmin3 = np.amin([np.amin(EMUPW_EA2_t0),np.amin(EMUPW_EA2_t1),np.amin(EMUPW_EA2_t21),np.amin(EMDOWNW_EA2_t0),np.amin(EMDOWNW_EA2_t1),np.amin(EMDOWNW_EA2_t21)]) +>>> vmax3 = np.amax([np.amax(EMUPW_EA2_t0),np.amax(EMUPW_EA2_t1),np.amax(EMUPW_EA2_t21),np.amax(EMDOWNW_EA2_t0),np.amax(EMDOWNW_EA2_t1),np.amax(EMDOWNW_EA2_t21)]) + +# plotting recurrent conns + +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUPrecW_t0,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EMUPrecW_t1,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EMUPrecW_t21,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EMDOWNrecW_t0,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p4 = lax[5].imshow(np.reshape(EMDOWNrecW_t21,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EMDOWNrecW_t1,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EMDOWNrecW_t21,(20,15)),vmin=vmin1,vmax=vmax1,cmap='jet') +>>> lax[0].set_xticks([]) +>>> lax[1].set_xticks([]) +>>> lax[2].set_xticks([]) +>>> lax[3].set_xticks([]) +>>> lax[4].set_xticks([]) +>>> lax[5].set_xticks([]) +>>> lax[0].set_yticks([]) +>>> lax[1].set_yticks([]) +>>> lax[2].set_yticks([]) +>>> lax[3].set_yticks([]) +>>> lax[4].set_yticks([]) +>>> lax[5].set_yticks([]) +>>> lax[0].set_ylabel('EMUP-recurrent',fontsize=8) +>>> lax[3].set_ylabel('EMDOWN-recurrent',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) + +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EMrecurweightsFigure2a_FullSam.eps +21jan28_EMrecurweightsFigure2a_FullSam.png + + +# EA to EM weights + +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUPW_EA_t0,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EMUPW_EA_t1,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EMUPW_EA_t21,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EMDOWNW_EA_t0,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EMDOWNW_EA_t1,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EMDOWNW_EA_t21,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> for i in range(6): +... lax[i].set_xticks([]) +... lax[i].set_yticks([]) + +>>> lax[0].set_ylabel('EA->EMUP',fontsize=8) +>>> lax[3].set_ylabel('EA->EMDOWN',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EAtoEMweightsFigure2b_FullSam.eps +21jan28_EAtoEMweightsFigure2b_FullSam.png + + +# EA2 to EM weights + +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUPW_EA2_t0,(20,15)),vmin=vmin2,vmax=vmax2,cmap='jet') +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUPW_EA2_t0,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EMUPW_EA2_t1,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EMUPW_EA2_t21,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EMDOWNW_EA2_t0,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EMDOWNW_EA2_t1,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EMDOWNW_EA2_t21,(20,15)),vmin=vmin3,vmax=vmax3,cmap='jet') +>>> for i in range(6): +... lax[i].set_xticks([]) +... lax[i].set_yticks([]) +>>> lax[0].set_ylabel('EA2->EMUP',fontsize=8) +>>> lax[3].set_ylabel('EA2->EMDOWN',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + + +saved as: +21jan28_EA2toEMweightsFigure2c_FullSam.eps +21jan28_EA2toEMweightsFigure2c_FullSam.png + + +# total input weights to EM + +>>> EMUP_t0 = np.add(EMUPrecW_t0,EMUPW_EA_t0,EMUPW_EA2_t0) +>>> EMUP_t1 = np.add(EMUPrecW_t1,EMUPW_EA_t1,EMUPW_EA2_t1) +>>> EMUP_t21 = np.add(EMUPrecW_t21,EMUPW_EA_t21,EMUPW_EA2_t21) +>>> EMDOWN_t0 = np.add(EMDOWNrecW_t0,EMDOWNW_EA_t0,EMDOWNW_EA2_t0) +>>> EMDOWN_t1 = np.add(EMDOWNrecW_t1,EMDOWNW_EA_t1,EMDOWNW_EA2_t1) +>>> EMDOWN_t21 = np.add(EMDOWNrecW_t21,EMDOWNW_EA_t21,EMDOWNW_EA2_t21) + +>>> vmin4 = np.amin([np.amin(EMUP_t0),np.amin(EMUP_t1),np.amin(EMUP_t21),np.amin(EMDOWN_t0),np.amin(EMDOWN_t1),np.amin(EMDOWN_t21)]) +>>> vmax4 = np.amax([np.amax(EMUP_t0),np.amax(EMUP_t1),np.amax(EMUP_t21),np.amax(EMDOWN_t0),np.amax(EMDOWN_t1),np.amax(EMDOWN_t21)]) + +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUP_t0,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EMUP_t1,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EMUP_t21,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EMDOWN_t0,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EMDOWN_t1,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EMDOWN_t21,(20,15)),vmin=vmin4,vmax=vmax4,cmap='jet') +>>> for i in range(6): +... lax[i].set_xticks([]) +... lax[i].set_yticks([]) +>>> lax[0].set_ylabel('[EA,EA2,EMUP]->EMUP',fontsize=8) +>>> lax[3].set_ylabel('[EA,EA2,EMDOWN]->EMDOWN',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EMweightsFigure2d_FullSam.png +21jan28_EMweightsFigure2d_FullSam.eps + +>>> EMUPW_EMDOWN_t0 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EMDOWN_t1 = np.zeros((dnumc['EMUP'],)) +>>> EMUPW_EMDOWN_t21 = np.zeros((dnumc['EMUP'],)) +>>> EMDOWNW_EMUP_t0 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EMUP_t1 = np.zeros((dnumc['EMDOWN'],)) +>>> EMDOWNW_EMUP_t21 = np.zeros((dnumc['EMDOWN'],)) + +>>> counter = 0 +>>> for cID in EMUPneuronIDs: +... EMUPW_EMDOWN_t0[counter]=np.sum(w0_BT0_EMUP_fromEMDOWN[w0_BT0_EMUP_fromEMDOWN.postid==cID]['weight']) +... EMUPW_EMDOWN_t1[counter]=np.sum(w0_EMUP_fromEMDOWN[w0_EMUP_fromEMDOWN.postid==cID]['weight']) +... EMUPW_EMDOWN_t21[counter]=np.sum(w21_EMUP_fromEMDOWN[w21_EMUP_fromEMDOWN.postid==cID]['weight']) +... counter+=1 +... +>>> counter = 0 +>>> for cID in EMDOWNneuronIDs: +... EMDOWNW_EMUP_t0[counter]=np.sum(w0_BT0_EMDOWN_fromEMUP[w0_BT0_EMDOWN_fromEMUP.postid==cID]['weight']) +... EMDOWNW_EMUP_t1[counter]=np.sum(w0_EMDOWN_fromEMUP[w0_EMDOWN_fromEMUP.postid==cID]['weight']) +... EMDOWNW_EMUP_t21[counter]=np.sum(w21_EMDOWN_fromEMUP[w21_EMDOWN_fromEMUP.postid==cID]['weight']) +... counter+=1 + +>>> vmin5 = np.amin([np.amin(EMUPW_EMDOWN_t0),np.amin(EMUPW_EMDOWN_t1),np.amin(EMUPW_EMDOWN_t21),np.amin(EMDOWNW_EMUP_t0),np.amin(EMDOWNW_EMUP_t1),np.amin(EMDOWNW_EMUP_t21)]) +>>> vmax5 = np.amax([np.amax(EMUPW_EMDOWN_t0),np.amax(EMUPW_EMDOWN_t1),np.amax(EMUPW_EMDOWN_t21),np.amax(EMDOWNW_EMUP_t0),np.amax(EMDOWNW_EMUP_t1),np.amax(EMDOWNW_EMUP_t21)]) + +>>> fig,axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EMUPW_EMDOWN_t0,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EMUPW_EMDOWN_t1,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EMUPW_EMDOWN_t21,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EMDOWNW_EMUP_t0,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EMDOWNW_EMUP_t1,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EMDOWNW_EMUP_t21,(20,15)),vmin=vmin5,vmax=vmax5,cmap='jet') +>>> for i in range(6): +... lax[i].set_xticks([]) +... lax[i].set_yticks([]) + +>>> lax[0].set_ylabel('EMDOWN->EMUP',fontsize=8) +>>> lax[3].set_ylabel('EMUP->EMDOWN',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EMcrossweightsFigure2e_FullSam.png +21jan28_EMcrossweightsFigure2e_FullSam.eps + + +>>> w0_BT0_EA_EMUP = w0_BT0_EA[(w0_BT0_EA.preid>=dstartidx['EMUP'])&(w0_BT0_EA.preid<=dendidx['EMUP'])] +>>> w0_BT0_EA_EMDOWN = w0_BT0_EA[(w0_BT0_EA.preid>=dstartidx['EMDOWN'])&(w0_BT0_EA.preid<=dendidx['EMDOWN'])] + +>>> w0_BT0_EA2_EMUP = w0_BT0_EA2[(w0_BT0_EA2.preid>=dstartidx['EMUP'])&(w0_BT0_EA2.preid<=dendidx['EMUP'])] +>>> w0_BT0_EA2_EMDOWN = w0_BT0_EA2[(w0_BT0_EA2.preid>=dstartidx['EMDOWN'])&(w0_BT0_EA2.preid<=dendidx['EMDOWN'])] + +>>> w0_EA_EMUP = w0_EA[(w0_EA.preid>=dstartidx['EMUP'])&(w0_EA.preid<=dendidx['EMUP'])] +>>> w0_EA2_EMUP = w0_EA2[(w0_EA2.preid>=dstartidx['EMUP'])&(w0_EA2.preid<=dendidx['EMUP'])] + +>>> w0_EA_EMDOWN = w0_EA[(w0_EA.preid>=dstartidx['EMDOWN'])&(w0_EA.preid<=dendidx['EMDOWN'])] +>>> w0_EA2_EMDOWN = w0_EA2[(w0_EA2.preid>=dstartidx['EMDOWN'])&(w0_EA2.preid<=dendidx['EMDOWN'])] + +>>> w21_EA_EMUP = w21_EA[(w21_EA.preid>=dstartidx['EMUP'])&(w21_EA.preid<=dendidx['EMUP'])] +>>> w21_EA2_EMUP = w21_EA2[(w21_EA2.preid>=dstartidx['EMUP'])&(w21_EA2.preid<=dendidx['EMUP'])] + +>>> w21_EA_EMDOWN = w21_EA[(w21_EA.preid>=dstartidx['EMDOWN'])&(w21_EA.preid<=dendidx['EMDOWN'])] +>>> w21_EA2_EMDOWN = w21_EA2[(w21_EA2.preid>=dstartidx['EMDOWN'])&(w21_EA2.preid<=dendidx['EMDOWN'])] + + + +>>> EAW_EMDOWN_t0 = np.zeros((dnumc['EA'],)) +>>> EAW_EMDOWN_t1 = np.zeros((dnumc['EA'],)) +>>> EAW_EMDOWN_t21 = np.zeros((dnumc['EA'],)) +>>> EA2W_EMDOWN_t0 = np.zeros((dnumc['EA2'],)) +>>> EA2W_EMDOWN_t1 = np.zeros((dnumc['EA2'],)) +>>> EA2W_EMDOWN_t21 = np.zeros((dnumc['EA2'],)) +>>> counter = 0 +>>> for cID in EAneuronIDs: +... EAW_EMUP_t0[counter]=np.sum(w0_BT0_EA_EMUP[w0_BT0_EA_EMUP.postid==cID]['weight']) +... EAW_EMUP_t1[counter]=np.sum(w0_EA_EMUP[w0_EA_EMUP.postid==cID]['weight']) +... EAW_EMUP_t21[counter]=np.sum(w21_EA_EMUP[w21_EA_EMUP.postid==cID]['weight']) +... EAW_EMDOWN_t0[counter]=np.sum(w0_BT0_EA_EMDOWN[w0_BT0_EA_EMDOWN.postid==cID]['weight']) +... EAW_EMDOWN_t1[counter]=np.sum(w0_EA_EMDOWN[w0_EA_EMDOWN.postid==cID]['weight']) +... EAW_EMDOWN_t21[counter]=np.sum(w21_EA_EMDOWN[w21_EA_EMDOWN.postid==cID]['weight']) +... counter+=1 +>>> counter = 0 +>>> for cID in EA2neuronIDs: +... EA2W_EMUP_t0[counter]=np.sum(w0_BT0_EA2_EMUP[w0_BT0_EA2_EMUP.postid==cID]['weight']) +... EA2W_EMUP_t1[counter]=np.sum(w0_EA2_EMUP[w0_EA2_EMUP.postid==cID]['weight']) +... EA2W_EMUP_t21[counter]=np.sum(w21_EA2_EMUP[w21_EA2_EMUP.postid==cID]['weight']) +... EA2W_EMDOWN_t0[counter]=np.sum(w0_BT0_EA2_EMDOWN[w0_BT0_EA2_EMDOWN.postid==cID]['weight']) +... EA2W_EMDOWN_t1[counter]=np.sum(w0_EA2_EMDOWN[w0_EA2_EMDOWN.postid==cID]['weight']) +... EA2W_EMDOWN_t21[counter]=np.sum(w21_EA2_EMDOWN[w21_EA2_EMDOWN.postid==cID]['weight']) +... counter+=1 + +>>> vmin6 = np.amin([np.amin(EAW_EMUP_t0),np.amin(EAW_EMUP_t1),np.amin(EAW_EMUP_t21),np.amin(EAW_EMDOWN_t0),np.amin(EAW_EMDOWN_t1),np.amin(EAW_EMDOWN_t21)]) +>>> vmax6 = np.amax([np.amax(EAW_EMUP_t0),np.amax(EAW_EMUP_t1),np.amax(EAW_EMUP_t21),np.amax(EAW_EMDOWN_t0),np.amax(EAW_EMDOWN_t1),np.amax(EAW_EMDOWN_t21)]) + +>>> vmin7 = np.amin([np.amin(EA2W_EMUP_t0),np.amin(EA2W_EMUP_t1),np.amin(EA2W_EMUP_t21),np.amin(EA2W_EMDOWN_t0),np.amin(EA2W_EMDOWN_t1),np.amin(EA2W_EMDOWN_t21)]) +>>> vmax7 = np.amax([np.amax(EA2W_EMUP_t0),np.amax(EA2W_EMUP_t1),np.amax(EA2W_EMUP_t21),np.amax(EA2W_EMDOWN_t0),np.amax(EA2W_EMDOWN_t1),np.amax(EA2W_EMDOWN_t21)]) + +>>> fig, axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EAW_EMUP_t0,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EAW_EMUP_t1,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EAW_EMUP_t21,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EAW_EMDOWN_t0,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EAW_EMDOWN_t1,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EAW_EMDOWN_t21,(30,20)),vmin=vmin6,vmax=vmax6,cmap='jet') +>>> for i in range(6): +... lax[i].set_xticks([]) +... lax[i].set_yticks([]) +... + + +>>> lax[0].set_ylabel('EM->EA',fontsize=8) +>>> lax[0].set_ylabel('EMUP->EA',fontsize=8) +>>> lax[3].set_ylabel('EMDOWN->EA',fontsize=8) +>>> lax[0].set_title('Initial',fontsize=8) +>>> lax[1].set_title('After T0',fontsize=8) +>>> lax[2].set_title('After T21',fontsize=8) +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EMfeedbackFigure2f_FullSam.png +21jan28_EMfeedbackFigure2f_FullSam.eps + + +>>> fig, axs = plt.subplots(2,3,figsize=(4,3)) +>>> lax = axs.ravel() +>>> p0 = lax[0].imshow(np.reshape(EA2W_EMUP_t0,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> p1 = lax[1].imshow(np.reshape(EA2W_EMUP_t1,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> p2 = lax[2].imshow(np.reshape(EA2W_EMUP_t21,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> p3 = lax[3].imshow(np.reshape(EA2W_EMDOWN_t0,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> p4 = lax[4].imshow(np.reshape(EA2W_EMDOWN_t1,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> p5 = lax[5].imshow(np.reshape(EA2W_EMDOWN_t21,(20,15)),vmin=vmin7,vmax=vmax7,cmap='jet') +>>> for i in range(6): +... lax[i].set_yticks([]) +... lax[i].set_xticks([]) + +>>> lax[0].set_ylabel('EM->EA2',fontsize=8) +Text(50.6577,0.5,'EM->EA2') +>>> lax[0].set_ylabel('EMUP->EA2',fontsize=8) +Text(50.6577,0.5,'EMUP->EA2') +>>> lax[3].set_ylabel('EMDOWN->EA2',fontsize=8) +Text(50.6577,0.5,'EMDOWN->EA2') +>>> lax[0].set_title('Initial',fontsize=8) +Text(0.5,1,'Initial') +>>> lax[1].set_title('After T0',fontsize=8) +Text(0.5,1,'After T0') +>>> lax[2].set_title('After T21',fontsize=8) +Text(0.5,1,'After T21') +>>> cbaxes = fig.add_axes([0.9,0.4,0.01,0.4]) +>>> plt.colorbar(p5,cax=cbaxes) + +saved as: +21jan28_EMfeedbackFigure2g_FullSam.png +21jan28_EMfeedbackFigure2g_FullSam.eps + +---------- +# EMUP rec conns +>>> r0_t0 = np.reshape(np.array(w0_BT0_EMUP_rec['weight']),(180,100)) +>>> r0_t1 = np.reshape(np.array(w0_EMUP_rec['weight']),(180,100)) +>>> r0_t21 = np.reshape(np.array(w21_EMUP_rec['weight']),(180,100)) + +# EMDOWN rec conns +>>> l0_t0 = np.reshape(np.array(w0_BT0_EMDOWN_rec['weight']),(180,100)) +>>> l0_t1 = np.reshape(np.array(w0_EMDOWN_rec['weight']),(180,100)) +>>> l0_t21 = np.reshape(np.array(w21_EMDOWN_rec['weight']),(180,100)) + +# cross EMUP to EMDOWN +>>> clr0_t0 = np.reshape(np.array(w0_BT0_EMDOWN_fromEMUP['weight']),(180,100)) +>>> clr0_t1 = np.reshape(np.array(w0_EMDOWN_fromEMUP['weight']),(180,100)) +>>> clr0_t21 = np.reshape(np.array(w21_EMDOWN_fromEMUP['weight']),(180,100)) + +# cross EMDOWN to EMUP +>>> crl0_t0 = np.reshape(np.array(w0_BT0_EMUP_fromEMDOWN['weight']),(180,100)) +>>> crl0_t1 = np.reshape(np.array(w0_EMUP_fromEMDOWN['weight']),(180,100)) +>>> crl0_t21 = np.reshape(np.array(w21_EMUP_fromEMDOWN['weight']),(180,100)) + + +# feedforward EA to EM +>>> fr0_t0 = np.reshape(np.array(w0_BT0_EMUP_fromEA['weight']),(200,150)) +>>> fr0_t1 = np.reshape(np.array(w0_EMUP_fromEA['weight']),(200,150)) +>>> fr21_t1 = np.reshape(np.array(w21_EMUP_fromEA['weight']),(200,150)) + +>>> fl0_t0 = np.reshape(np.array(w0_BT0_EMDOWN_fromEA['weight']),(200,150)) +>>> fl0_t1 = np.reshape(np.array(w0_EMDOWN_fromEA['weight']),(200,150)) +>>> fl0_t21 = np.reshape(np.array(w21_EMDOWN_fromEA['weight']),(200,150)) + +# feedforward EA2 to EM +>>> fr1_t0 = np.reshape(np.array(w0_BT0_EMUP_fromEA2['weight']),(180,100)) +>>> fr1_t1 = np.reshape(np.array(w0_EMUP_fromEA2['weight']),(180,100)) +>>> fr1_t21 = np.reshape(np.array(w21_EMUP_fromEA2['weight']),(180,100)) + +>>> fl1_t0 = np.reshape(np.array(w0_BT0_EMDOWN_fromEA2['weight']),(180,100)) +>>> fl1_t1 = np.reshape(np.array(w0_EMDOWN_fromEA2['weight']),(180,100)) +>>> fl1_t21 = np.reshape(np.array(w21_EMDOWN_fromEA2['weight']),(180,100)) + + +# should plot as total input weights to postsynaptic pop. +# e.g. 300 (20x15) for EMUP and EMDOWN +# 600 (30x20) for EA +# 300 (20x15) for EA2. + +>>> fig, axs = plt.subplots(1,3,figsize=(8,3)) +>>> lax = axs.ravel() +>>> p1 = lax[0].imshow(fr1_t0,vmin=np.amin(fr1_t21),vmax=np.amax(fr1_t21),cmap='jet') +>>> p2 = lax[1].imshow(fr1_t1,vmin=np.amin(fr1_t21),vmax=np.amax(fr1_t21),cmap='jet') +>>> p3 = lax[2].imshow(fr1_t21,vmin=np.amin(fr1_t21),vmax=np.amax(fr1_t21),cmap='jet') +cbaxes = fig.add_axes([0.95, 0.4, 0.01, 0.2]) +plt.colorbar(p3, cax = cbaxes) + + + +-------------- +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan6_TARG4_gcp__step_0_sim.json simFull.json +nano simFull.json +"name": "21jan30_TARG4_L1_cycle__step_0_", +RL: AMPA: RLhebbwt: 0.1 (change from 0.01 to 0.1) +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFull.json 30 20 21jan30_RL4_L1_cycle_multi + +UNSUCCESSFUL IN SAVING OUTPUT +---------------- +nano simFull.json +"name": "21jan30_TARG4_L2_cycle__step_0_", +RL: AMPA: RLhebbwt: 0.5 (change from 0.01 to 0.5) +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFull.json 30 20 21jan30_RL4_L2_cycle_multi + +UNSUCCESSFUL IN SAVING OUTPUT +----------------- + +"name": "21feb1_TARG4_L1_cycle_", +"RLhebbwt": 0.02, +python multistepSim.py simFull.json 30 20 21feb1_RL4_L1_cycle_multi + +----------------- + +"name": "21feb1_TARG4_L2_cycle_", +"RLhebbwt": 0.05 + +------------------ + +* 21feb2 + +- for any input sequence Iseq, measure firing rate of each M neuron in EMUP and EMDOWN populations. +- see how those firing rate matrices evolve with repeated occurances. +- this could be done in 2 ways 1) with fixed weight and 2) with evolving weights. +- lets do that for the fixed weight first..... + +... using Initital weights i.e. before training. + +python -i simdat.py backupcfg/21jan21_TARG4_gcp_RLhebbwt_0_p0_sim.json + +...... so one challenge is to find out exact time bins for input presentation. + +use dt of 49.8 ms..... (not accurate but good approximation) + +tpnts = range(0,totalDur,tstepPerAction) + +# find input sequences. +lSimilarSeqs, seqs2plot, seqBegs, seqEnds_wrtRewards = breakdownPerformance(InputImages,actreward,cend=69,sthresh=5) + +# find activity vectors for pops. +>>> dact1D = getdActMap1D(totalDur,tstepPerAction,dspkT, dspkID, dnumc, dstartidx, lpop = ['EMUP', 'EMDOWN']) + + + +# sort and extract cummulative activity of each neuron in Motor pop across steps for any input sequence..... + + # spkT = dspkT[pop] + # spkID = dspkID[pop] + # startidx = dstartidx[pop] + # NBneurons = dnumc[pop] + +def getCumActivityMapForInput(t1,t2,dact1D,lpop): + dCumAct = {} + dStepAct = {} + for pop in lpop: + dCumAct[pop] = [] + dStepAct[pop] = [] + for i in range(len(t1)): + cPopAct = list(np.sum(dact1D[pop][t1[i]:t2[i]+1,:],0)) + cPopStepAct = list(dact1D[pop][t1[i]:t2[i]+1,:]) + dCumAct[pop].append(cPopAct) + dStepAct[pop].append(cPopStepAct) + return dCumAct, dStepAct + +# find stepwise and cummulative activity of all neurons for all sequences. +dCumAct, dStepAct = getCumActivityMapForInput(seqBegs,seqEnds_wrtRewards,dact1D,lpop=['EMUP','EMDOWN']) + +# find stepwise rewards (reward) and hit.miss for all sequences. + + +def getRewardsPerSeq(actreward, seqBegs, seqEnds_wrtRewards): + rewards = [] + hitsMiss = [] + for seq in range(len(seqBegs)): + cseqRewards = [] + cseqHitMiss = [] + begs = seqBegs[seq] + ends = seqEnds_wrtRewards[seq] + for i in range(begs,ends+1): + cseqRewards.append(actreward.reward[i]) + if i==ends: + cseqHitMiss.append(actreward.hit[i]) + else: + cseqHitMiss.append(0) + rewards.append(cseqRewards) + hitsMiss.append(cseqHitMiss) + return rewards,hitsMiss + + +-- There is a bug in function +breakdownPerformance(InputImages,actreward,cend,sthresh) + +-- hopefully bug is fixed now..... +use breakdownPerformance function as +....... + +# find input sequences. +lSimilarSeqs, seqs2plot, seqBegs, seqEnds = breakdownPerformance(InputImages,actreward,cend = 69 ,sthresh = 5) + +# find activity vectors for pops. +dact1D = getdActMap1D(totalDur,tstepPerAction,dspkT, dspkID, dnumc, dstartidx, lpop = ['EMUP', 'EMDOWN']) + +# find stepwise and cummulative activity of all neurons for all sequences. +dCumAct, dStepAct = getCumActivityMapForInput(seqBegs,seqEnds,dact1D,lpop=['EMUP','EMDOWN']) + +# find stepwise rewards (reward) and hit.miss for all sequences. +rewards, hitsMiss = getRewardsPerSeq(actreward, seqBegs, seqEnds) + +---- +# so far can parse and split activity based on single run...... + +# should be able to do that for multiple runs...... + +... try here.... + +>>> lfnBT = ['21jan21_TARG4_gcp_RLhebbwt_0_p0_', + '21jan21_TARG4_gcp_RLhebbwt_0_p1_', + '21jan21_TARG4_gcp_RLhebbwt_0_p2_', + '21jan21_TARG4_gcp_RLhebbwt_0_p3_', + '21jan21_TARG4_gcp_RLhebbwt_0_p4_'] + + +# loading all input images.... +>>> II_allBT = getconcatactioninputs (lfnBT) +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p0_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p4_InputImages.txt + +# loading all actrewards +>>> actrewards_allBT = getconcatactionreward(lfnBT) + +# find input sequences across multiple steps +>>> lSimilarSeqs, seqs2plot, seqBegs, seqEnds = breakdownPerformance(II_allBT, actrewards_allBT, cend = 69, sthresh = 5, nbframeThresh=5) +>>> len(seqBegs) +387 +>>> len(seqEnds) +387 +>>> len(seqs2plot) +20 +>>> lSimilarSeqs[seqs2plot[0]] +[0, 18, 40, 95, 99, 111, 114, 120, 125, 198, 227, 233, 253, 257, 307, 345, 359, 375] + +>>> plt.imshow(np.sum(II_allBT[seqBegs[18]:seqEnds[18],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[40]:seqEnds[40],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[95]:seqEnds[95],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[99]:seqEnds[99],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[111]:seqEnds[111],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[114]:seqEnds[114],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[120]:seqEnds[120],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[125]:seqEnds[125],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[198]:seqEnds[198],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[227]:seqEnds[227],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[233]:seqEnds[233],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[253]:seqEnds[253],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[257]:seqEnds[257],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[307]:seqEnds[307],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[346]:seqEnds[345],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[360]:seqEnds[359],:,:],0)) +>>> plt.imshow(np.sum(II_allBT[seqBegs[376]:seqEnds[375],:,:],0)) + +finally fixed the problem with incomplete sequences. + + + +----------- +# try simple version ---- tested this function and it looks OK +def getconcatactivity(lfn, lpop = allpossible_pops): + spkIDs = [] + spkTs = [] + t_lastSim = 0 + for fn in lfn: + conf.dconf = conf.readconf('backupcfg/'+fn+'sim.json') + simConfig = pickle.load(open('data/'+fn+'simConfig.pkl','rb')) + spkT = np.add(simConfig['simData']['spkt'],t_lastSim) + spkID = np.array(simConfig['simData']['spkid']) + for i in range(len(spkT)): + spkTs.append(spkT[i]) + spkIDs.append(spkID[i]) + totalDur = int(dconf['sim']['duration']) + t_lastSim = t_lastSim + totalDur + dstartidx, dendidx = {},{} + for p in lpop: + dstartidx[p] = simConfig['net']['pops'][p]['cellGids'][0] + dendidx[p] = simConfig['net']['pops'][p]['cellGids'][-1] + dspkID,dspkT = {},{} + spkIDs = np.array(spkIDs) + spkTs = np.array(spkTs) + for pop in lpop: + dspkID[pop] = spkIDs[(spkIDs>=dstartidx[pop])&(spkIDs<=dendidx[pop])] + dspkT[pop] = spkTs[(spkIDs>=dstartidx[pop])&(spkIDs<=dendidx[pop])] + return dspkID, dspkT + +# concatenate the activity +>>> dspkID, dspkT, totalDur = getconcatactivity(lfnBT, lpop = ['EMUP','EMDOWN']) + + +# find activity vectors for pops. +>>> totalDur = totalDur*5 +dact1D = getdActMap1D(totalDur,tstepPerAction,dspkT, dspkID, dnumc, dstartidx, lpop = ['EMUP', 'EMDOWN']) + +# find stepwise and cummulative activity of all neurons for all sequences. +dCumAct, dStepAct = getCumActivityMapForInput(seqBegs,seqEnds,dact1D,lpop=['EMUP','EMDOWN']) + +----------------- +...testing all analysis functions..... + +>>> lfnBT = ['21jan21_TARG4_gcp_RLhebbwt_0_p0_','21jan21_TARG4_gcp_RLhebbwt_0_p1_','21jan21_TARG4_gcp_RLhebbwt_0_p2_','21jan21_TARG4_gcp_RLhebbwt_0_p3_','21jan21_TARG4_gcp_RLhebbwt_0_p4_'] +# loading all input images.... +>>> II_allBT = getconcatactioninputs(lfnBT) +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p0_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p4_InputImages.txt +# loading all actrewards +>>> actrewards_allBT = getconcatactionreward(lfnBT) +# find input sequences across multiple steps +>>> lSimilarSeqs_allBT, seqs2plot_allBT, seqsBegs_allBT, seqsEnds_allBT = breakdownPerformance(II_allBT,actrewards_allBT,cend=69,sthresh = 5, nbframeThresh=5) +# concatenate the activity +>>> dspkID_allBT, dspkT_allBT, totalDur_allBT = getconcatactivity(lfnBT,lpop=['EMUP','EMDOWN']) # probably OK to use dnumc, dstartidx globally, (be careful when using different set of sims...not sure if makes sense). +# find activity vectors for pops. +>>> dact1D_allBT = getdActMap1D(totalDur_allBT, tstepPerAction,dspkT_allBT,dspkID_allBT,dnumc,dstartidx,lpop=['EMUP','EMDOWN']) +# find stepwise and cummulative activity of all neurons for all sequences. +>>> dCumAct_allBT, dStepAct_allBT = getCumActivityMapForInput(seqsBegs_allBT,seqsEnds_allBT,dact1D_allBT,lpop=['EMUP','EMDOWN']) +# find rewards and hit/miss points for all sequences. +>>> rewards_allBT, hitsMiss_allBT = getRewardsPerSeq(actrewards_allBT,seqsBegs_allBT, seqsEnds_allBT) + +...these are before training +>>> D1 = np.array(dCumAct_allBT['EMDOWN']) +>>> U1 = np.array(dCumAct_allBT['EMUP']) + + +>>> plt.plot(np.sum(U1[lSimilarSeqs_allBT[seqs2plot_allBT[0]],:],1),'-o') +[] +>>> plt.plot(np.sum(D1[lSimilarSeqs_allBT[seqs2plot_allBT[0]],:],1),'r-o') +[] +>>> plt.plot(np.sum(U1[lSimilarSeqs_allBT[seqs2plot_allBT[1]],:],1),'-o') +[] +>>> plt.plot(np.sum(D1[lSimilarSeqs_allBT[seqs2plot_allBT[1]],:],1),'r-o') + + +-------- + +>>> lfnT +['21jan6_TARG4_gcp__step_0_', '21jan6_TARG4_gcp__step_1_', '21jan6_TARG4_gcp__step_2_', '21jan6_TARG4_gcp__step_3_', '21jan6_TARG4_gcp__step_4_', '21jan6_TARG4_gcp__step_5_', '21jan6_TARG4_gcp__step_6_', '21jan6_TARG4_gcp__step_7_', '21jan6_TARG4_gcp__step_8_', '21jan6_TARG4_gcp__step_9_', '21jan6_TARG4_gcp__step_10_', '21jan6_TARG4_gcp__step_11_', '21jan6_TARG4_gcp__step_12_', '21jan6_TARG4_gcp__step_13_', '21jan6_TARG4_gcp__step_14_', '21jan6_TARG4_gcp__step_15_', '21jan6_TARG4_gcp__step_16_', '21jan6_TARG4_gcp__step_17_', '21jan6_TARG4_gcp__step_18_', '21jan6_TARG4_gcp__step_19_', '21jan11_TARG4_gcp__step_0_', '21jan11_TARG4_gcp__step_1_', '21jan11_TARG4_gcp__step_2_'] + +>>> II_allT = getconcatactioninputs(lfnT) +loading input images from data/21jan6_TARG4_gcp__step_0_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_1_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_2_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_3_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_4_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_5_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_6_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_7_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_8_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_9_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_10_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_11_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_12_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_13_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_14_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_15_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_16_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_17_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_18_InputImages.txt +loading input images from data/21jan6_TARG4_gcp__step_19_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_0_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_1_InputImages.txt +loading input images from data/21jan11_TARG4_gcp__step_2_InputImages.txt + +>>> actrewards_allT = getconcatactionreward(lfnT) +>>> lSimilarSeqs_allT, seqs2plot_allT, seqsBegs_allT, seqsEnds_allT = breakdownPerformance(II_allT,actrewards_allT,cend=69,sthresh = 5, nbframeThresh=5) +>>> dspkID_allT, dspkT_allT, totalDur_allT = getconcatactivity(lfnT,lpop=['EMUP','EMDOWN']) +>>> dact1D_allT = getdActMap1D(totalDur_allT, tstepPerAction, dspkT_allT, dspkID_allT, dnumc, dstartidx, lpop = ['EMUP','EMDOWN']) +>>> dCumAct_allT, dStepAct_allT = getCumActivityMapForInput(seqsBegs_allT, seqsEnds_allT, dact1D_allT, lpop = ['EMUP','EMDOWN']) +>>> rewards_allT, hitsMiss_allT = getRewardsPerSeq(actrewards_allT, seqsBegs_allT, seqsEnds_allT) + +... for now plot on commandline--- later can make a function.... + +>>> len(seqs2plot_allT) +46 +... there are 46 input sequences that repeated for more than 5 times. + +>>> s1 = lSimilarSeqs_allT[seqs2plot_allT[0]] # first sequence rep indices. +>>> s1 +[0, 33, 41, 47, 61, 73, 93, 115, 120, 144, 150, 168, 197, 214, 231, 250, 254, 267, 278, 297, 321, 342, 358, 386, 405, 415, 421, 433, 451, 473, 493, 502, 538, 577, 582, 626, 642, 651, 668, 687, 692, 698, 707, 722, 740, 770, 796, 813, 838, 844, 872, 893, 897, 909, 918, 924, 936, 955, 980, 986, 995, 1001, 1002, 1021, 1038, 1043, 1049, 1079, 1097, 1101, 1124, 1144, 1145, 1163, 1188, 1193, 1212, 1216, 1235, 1260, 1280, 1289, 1332, 1337, 1357, 1363, 1380, 1405, 1425, 1440, 1475, 1487, 1508, 1509, 1552, 1558, 1567, 1579, 1596, 1600, 1620, 1626] + +>>> len(s1) +102 +... first seq repeated 102 times. + +# show the input pattern +>>> plt.imshow(np.sum(II_allT[seqsBegs_allT[s1[0]]:seqsEnds_allT[s1[0]]],0)) # first instance of input sequence s1 + +# show the evolution of cummulative activity with repeated input sequences +>>> s1_cumact_up = np.array(dCumAct_allT['EMUP'])[s1,:] # EMUP activity of 300 neurons for all instrances of sequence s1 +goodInds = np.where(s1_cumact_up[:,0]>> plt.plot(np.sum(s1_cumact_up[goodInds,:],1),'b-o') +>>> plt.plot(np.sum(s1_cumact_down[goodInds,:],1),'r-o') + +# show the evolution of hit/miss +cHitsMiss = [] +>>> for i in range(len(s1)): + if i in goodInds: +... cHitsMiss.append(hitsMiss_allT[s1[i]][-1]) + +cHitsMiss = np.array(cHitsMiss) +chits = np.where(cHitsMiss==1,cHitsMiss,0) +miss = np.where(cHitsMiss==-1,-1*cHitsMiss,0) +>>> plt.plot(np.divide(np.cumsum(hits),np.cumsum(miss)),'-o') + + + +..... how to show it..... + +def plotSeqPerf(lSimilarSeqs,seqs2plot,seqsBegs,seqsEnds,InputImages,dCumAct,hitsMiss,seqNB): + fig,axs = plt.subplots(3,1,figsize=(4,6)) + lax = axs.ravel() + i = seqNB + cseqInds = lSimilarSeqs[seqs2plot[i]] + cseqInput = np.zeros(shape=(len(cseqInds),InputImages.shape[1],InputImages.shape[2])) + for j in range(len(cseqInds)): + cseqInput[j,:,:] = np.sum(InputImages[seqsBegs[cseqInds[j]]:seqsEnds[cseqInds[j]],:,:],0) + lax[0].imshow(np.sum(cseqInput,0)) + lax[0].set_xticks([]) + lax[0].set_yticks([]) + cseq_cumact_up = np.array(dCumAct['EMUP'])[cseqInds,:] + cseq_cumact_down = np.array(dCumAct['EMDOWN'])[cseqInds,:] + goodInds = np.where(cseq_cumact_up[:,0]>> def plotSeqPerf(lSimilarSeqs,seqs2plot,seqsBegs,seqsEnds,InputImages,dCumAct,hitsMiss,seqNB,plotact=False): +... if plotact: + fig,axs = plt.subplots(2,2,figsize=(6,6)) + else: + fig,axs = plt.subplots(2,1,figsize=(4,6)) +... lax=axs.ravel() +... cseqInds = lSimilarSeqs[seqs2plot[seqNB]] +... cseqInput = np.zeros(shape=(len(cseqInds),InputImages.shape[1],InputImages.shape[2])) +... for j in range(len(cseqInds)): +... cseqInput[j,:,:] = np.sum(InputImages[seqsBegs[cseqInds[j]]:seqsEnds[cseqInds[j]],:,:],0) +... lax[0].imshow(np.sum(cseqInput,0)) +... lax[0].set_yticks([]) +... lax[0].set_xticks([]) +... cseq_cumact_up = np.array(dCumAct['EMUP'])[cseqInds,:] +... cseq_cumact_down = np.array(dCumAct['EMDOWN'])[cseqInds,:] +... goodInds = np.where(cseq_cumact_up[:,0]>> all_hits_miss = [] +>>> for i in range(len(seqs2plot_allT)): +... cseqInds = lSimilarSeqs_allT[seqs2plot_allT[i]] +... cHitsMiss = [] +... cseq_cumact_up = np.array(dCumAct_allT['EMUP'])[cseqInds,:] +... goodInds = np.where(cseq_cumact_up[:,0]>> all_hits_miss = np.array(all_hits_miss) + +>>> plt.plot(np.sum(all_hits_miss,1),all_hits_miss[:,0],'o') +[] +>>> plt.plot(np.sum(all_hits_miss,1),all_hits_miss[:,1],'ro') +[] + + +--- TO COMPARE with BEFORE Training + +>>> lfnBT +['21jan21_TARG4_gcp_RLhebbwt_0_p0_', '21jan21_TARG4_gcp_RLhebbwt_0_p1_', '21jan21_TARG4_gcp_RLhebbwt_0_p2_', '21jan21_TARG4_gcp_RLhebbwt_0_p3_', '21jan21_TARG4_gcp_RLhebbwt_0_p4_'] + + +-- POTENTIAL ERROR: + plotSeqPerf(lSimilarSeqs_allBT,seqs2plot_allBT,seqsBegs_allBT,seqsEnds_allBT,II_allBT,dCumAct_allBT,hitsMiss_allBT,8) +>>> plotSeqPerf(lSimilarSeqs_allBT,seqs2plot_allBT,seqsBegs_allBT,seqsEnds_allBT,II_allBT,dCumAct_allBT,hitsMiss_allBT,17) + +-- run simFullHA with modifications (Feb5) + +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ cp backupcfg/21jan22_cycle_21jan11_falcor_RL3_F6__step_0_sim.json simFullHA.json +"name": "21feb5_cycle_RL3_A0_", +RL: AMPA: + RLhebbwt: 0.1 (reduced from 0.5) + RLlenhebb: 100 + RLlenanti: 100 +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 30 20 21feb5_RL3_A0_cycle_multi + +-- run simFullHA with another modifications (Feb5) + + "name": "21feb5_cycle_RL3_B0_" + RLlenhebb: 50 + RLlenanti: 50 + RLwindhebb: 25 (reduced from 50) +(base) hanwar@cycle:~/GamesProject/SMARTAgent$ python multistepSim.py simFullHA.json 30 20 21feb5_RL3_B0_cycle_multi + + +-- Repeating the analysis (Feb10,2021) + +# load performance of full sims (sam's model on gcp) before Training +... note that the sims before training were run on cycle... +... note that the sims after training were also run on cycle.... +... but the training sims were run on gcp.... + +>>> lfnBT = ['21jan21_TARG4_gcp_RLhebbwt_0_p0_','21jan21_TARG4_gcp_RLhebbwt_0_p1_','21jan21_TARG4_gcp_RLhebbwt_0_p2_','21jan21_TARG4_gcp_RLhebbwt_0_p3_','21jan21_TARG4_gcp_RLhebbwt_0_p4_','21jan21_TARG4_gcp_RLhebbwt_0_p5_'] +>>> II_allBT = getconcatactioninputs(lfnBT) +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p0_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p1_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p2_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p3_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p4_InputImages.txt +loading input images from data/21jan21_TARG4_gcp_RLhebbwt_0_p5_InputImages.txt + +>>> actrewards_allBT = getconcatactionreward(lfnBT) + +>>> lSimilarSeqs_allBT, seqs2plot_allBT, seqsBegs_allBT, seqsEnds_allBT = breakdownPerformance(II_allBT,actrewards_allBT,cend=69,sthresh=5,nbframeThresh=5) + +>>> dspkID_allBT, dspkT_allBT, totalDur_allBT = getconcatactivity(lfnBT,lpop=['EA','EA2','EMUP','EMDOWN']) + +>>> dact1D_allBT = getdActMap1D(totalDur_allBT, tstepPerAction, dspkT_allBT, dspkID_allBT, dnumc, dstartidx, lpop = ['EA','EA2','EMUP','EMDOWN']) + +>>> dCumAct_allBT, dStepAct_allBT = getCumActivityMapForInput(seqsBegs_allBT, seqsEnds_allBT, dact1D_allBT, lpop = ['EA','EA2','EMUP','EMDOWN']) + +>>> rewards_allBT, hitsMiss_allBT = getRewardsPerSeq(actrewards_allBT, seqsBegs_allBT, seqsEnds_allBT) \ No newline at end of file diff --git a/sim.json b/sim.json index 2ea98391..1b7b435c 100644 --- a/sim.json +++ b/sim.json @@ -1,445 +1,809 @@ { - "env": { - "name": "PongNoFrameskip-v4", - "savemp4": 0 + "env": { + "name": "PongNoFrameskip-v4", + "savemp4": 0 + }, + "randmove": 0, + "useSimulatedEnv": 1, + "simulatedEnvParams": { + "random": 0, + "yball": 80, + "yracket": 40, + "racket_dy": 5, + "dodraw": 0 + }, + "moves": { + "UP": 4, + "DOWN": 3, + "NOMOVE": 1 + }, + "movecodes": [ + 1, + 3, + 4 + ], + "wiggle": 6, + "stochmove": 0, + "0rand": 0, + "movefctr": 1.0, + "avoidStuck": 0, + "useImagePadding": 0, + "rewardcodes": { + "scorePoint": 0.0, + "losePoint": 0.0, + "followTarget": 0.1, + "avoidTarget": -0.01, + "hitBall": 0.2 + }, + "actionsPerPlay": 1, + "followOnlyTowards": 0, + "useRacketPredictedPos": 1, + "useFollowMoveOutput": 0, + "DirectionDetectionAlgo": { + "CentroidTracker": 1, + "OpticFlow": 0, + "FlowWidth": 1, + "UseFull": 1 + }, + "verbose": 0, + "stayStepLim": 0, + "simtype": { + "ResumeSim": 0, + "ResumeSimFromFile": "data/20dec10_B0_cycle_reduced_2obj_INTF7_synWeights_final.pkl" + }, + "sim": { + "duration": 500000, + "dt": 0.6, + "verbose": 0, + "recordStep": 1.0, + "recordStim": 0, + "recordWeightStepSize": 1000, + "normalizeWeightStepSize": 50000000000000000000000000, + "normalizeWeightsAtStart": 0, + "RLFakeUpRule": 0, + "RLFakeDownRule": 0, + "RLFakeStayRule": 0, + "name": "20dec27_A0_cycle_reduced_2obj_INTF7_", + "doquit": 1, + "doplot": 0, + "saveCellSecs": 0, + "saveCellConns": 0, + "targettedRL": 0, + "targettedRLOppFctr": 0.5, + "anticipatedRL": 0, + "tstepPerAction": 20, + "saveWeights": 1, + "saveAssignedFiringRates": 0, + "useReducedNetwork": 1, + "captureTwoObjs": 1 + }, + "architectureVtoA": { + "useProbabilistic": 0, + "useTopological": 0 + }, + "architectureVtoM": { + "useProbabilistic": 1, + "useTopological": 0 + }, + "net": { + "EEGain": 1.0, + "EIGain": 1.0, + "IEGain": 1.0, + "IIGain": 1.0, + "ECellModel": "INTF7", + "ICellModel": "INTF7", + "scale": 1, + "allpops": { + "ER": 0, + "IR": 0, + "EV1": 40, + "EV1DE": 1, + "EV1DNE": 1, + "EV1DN": 1, + "EV1DNW": 1, + "EV1DW": 1, + "EV1DSW": 1, + "EV1DS": 1, + "EV1DSE": 1, + "ID": 0, + "IV1": 0, + "EV4": 0, + "IV4": 0, + "EMT": 0, + "IMT": 0, + "EA": 3200, + "IA": 0, + "EA2": 0, + "IA2": 0, + "EMDOWN": 300, + "EMUP": 300, + "EMSTAY": 0, + "IM": 150, + "IMUP": 0, + "IMDOWN": 0, + "IMSTAY": 0 }, - "randmove":0, - "useSimulatedEnv": 1, - "simulatedEnvParams": { - "random":0, - "yball":80, - "yracket":40, - "racket_dy":5, - "dodraw": 0 + "ETypes": [ + "ER", + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT", + "EMDOWN", + "EMUP", + "EMSTAY", + "EA", + "EA2" + ], + "ITypes": [ + "IR", + "IV1", + "IV4", + "IMT", + "IM", + "ID", + "IMUP", + "IMDOWN", + "IMSTAY", + "IA", + "IA2" + ], + "EMotorPops": [ + "EMDOWN", + "EMUP", + "EMSTAY" + ], + "EVPops": [ + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT" + ], + "EVDirPops": [ + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE" + ], + "IVDirPops": [ + "ID" + ], + "EVLocPops": [ + "EV1", + "EV4", + "EMT" + ], + "AngRFSigma": 22.5, + "EXPDir": 0, + "VTopoI": 0, + "alltopoldivcons": { + "IR": { + "ER": 5 + }, + "EV1": { + "ER": 3 + }, + "IV1": { + "EV1": 5, + "ER": 5 + }, + "EV4": { + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "IV4": { + "EV4": 5, + "EV1": 5 + }, + "EMT": { + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "IMT": { + "EMT": 5, + "EV4": 5 + } }, - "moves": { - "UP": 4, - "DOWN": 3, - "NOMOVE": 1 + "alltopolconvcons": { + "ER": { + "IR": 3, + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1": { + "IV1": 3, + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DE": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DNE": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DN": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DNW": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DW": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DSW": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DS": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "EV1DSE": { + "EMDOWN": 3, + "EMUP": 3, + "EMSTAY": 3 + }, + "IV1": { + "IV4": 5 + }, + "EV4": { + "IV4": 3, + "EMT": 3 + }, + "IV4": { + "IMT": 5 + }, + "EMT": { + "IMT": 3 + } }, - "movecodes": [ - 1, - 3, - 4 - ], - "wiggle": 6, - "stochmove": 0, - "0rand": 0, - "movefctr": 1.0, - "avoidStuck":0, - "useImagePadding":0, - "rewardcodes": { - "scorePoint": 0.0, - "losePoint": 0.0, - "followTarget": 0.1, - "avoidTarget": -0.01, - "hitBall": 0.2 + "STDPconns": { + "EIPlast": 0, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 0, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 0, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 }, - "actionsPerPlay": 1, - "followOnlyTowards": 0, - "useRacketPredictedPos": 1, - "useFollowMoveOutput": 0, - "DirectionDetectionAlgo": { - "CentroidTracker": 1, - "OpticFlow": 0, - "FlowWidth": 1, - "UseFull": 1 + "RLconns": { + "EIPlast": 0, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 1, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 0, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 }, - "verbose": 0, - "stayStepLim": 0, - "simtype": { - "ResumeSim": 0, - "ResumeSimFromFile": "data/20dec10_B0_cycle_reduced_2obj_INTF7_synWeights_final.pkl" + "useBinaryImage": 1, + "DirMinRate": 0.0, + "DirMaxRate": 100.0, + "LocMaxRate": 100.0, + "FiringRateCutoff": 50.0, + "stimModVD": 36.25, + "stimModVL": 36.25, + "cmat": { + "VL": { + "VD": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "VL": { + "AM": 4, + "NM": 0.6, + "p": 0 + }, + "EA": { + "AM": 12, + "NM": 0.36, + "p": 0.1 + }, + "EMDOWN": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + }, + "EMUP": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + }, + "EMSTAY": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + } + }, + "VD": { + "VL": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "VD": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "EA": { + "AM": 12, + "NM": 0.36, + "p": 0.1 + }, + "EMDOWN": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + }, + "EMUP": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + }, + "EMSTAY": { + "AM": 0.5, + "NM": 0.001, + "p": 0.08 + }, + "ID": { + "AM": 10, + "p": 0.03 + } + }, + "EM": { + "EM": { + "AM": 1.6, + "NM": 0.001, + "p": 0.15 + }, + "EA": { + "AM": 0, + "NM": 0, + "p": 0.0 + }, + "IRecip": { + "AM": 20, + "NM": 0, + "p": 0.0625 + }, + "IM": { + "AM": 10, + "p": 0.125 + } + }, + "EA": { + "EA": { + "AM": 1.2, + "NM": 0.12, + "p": 0.0 + }, + "EA2": { + "AM": 1.2, + "NM": 0.12, + "p": 0.2 + }, + "EM": { + "AM": 7.5, + "NM": 0.001, + "p": 0.2 + }, + "IA": { + "AM": 10, + "p": 0.1 + } + }, + "EA2": { + "EA": { + "AM": 1.2, + "NM": 0.12, + "p": 0.0 + }, + "EA2": { + "AM": 1.2, + "NM": 0.12, + "p": 0.1 + }, + "EM": { + "AM": 1.2, + "NM": 0.12, + "p": 0.2 + }, + "IA2": { + "AM": 10, + "p": 0.0625 + } + }, + "IR": { + "IR": { + "GA": 2.5, + "p": 0.15 + } + }, + "IV1": { + "EV1": { + "GA": 5, + "p": 0.1 + }, + "IV1": { + "GA": 2.5, + "p": 0.1 + }, + "ER": { + "GA": 1.0, + "p": 0.0 + }, + "IV4": { + "GA": 0.375, + "p": 0.0 + } + }, + "ID": { + "ED": { + "GA": 5, + "p": 0.1 + }, + "ID": { + "GA": 2.5, + "p": 0.1 + } + }, + "IV4": { + "EV4": { + "GA": 10, + "p": 0.25 + }, + "IV4": { + "GA": 2.5, + "p": 0.25 + }, + "EV1": { + "GA": 1.0, + "p": 0.0 + }, + "IMT": { + "GA": 0.375, + "p": 0.0 + } + }, + "IMT": { + "EMT": { + "GA": 10, + "p": 0.25 + }, + "IMT": { + "GA": 2.5, + "p": 0.25 + }, + "EV4": { + "GA": 1.0, + "p": 0.0 + } + }, + "IM": { + "EM": { + "GA": 5, + "p": 0.25 + }, + "IM": { + "GA": 2.5, + "p": 0.1 + } + }, + "IMRecip": { + "EM": { + "GA": 10, + "p": 0.125 + } + }, + "IA": { + "EA": { + "GA": 5, + "p": 0.1 + }, + "IA": { + "GA": 2.5, + "p": 0.1 + } + }, + "IA2": { + "EA2": { + "GA": 5, + "p": 0.1 + }, + "IA2": { + "GA": 2.5, + "p": 0.15 + } + }, + "IMUP": { + "IMUP": { + "GA": 2.5, + "p": 0.15 + } + }, + "IMDOWN": { + "IMDOWN": { + "GA": 2.5, + "p": 0.15 + } + }, + "IMSTAY": { + "IMSTAY": { + "GA": 2.5, + "p": 0.15 + } + }, + "ER": { + "EV1": { + "AM": 4.0, + "NM": 0.6, + "p": 0.1 + } + }, + "EV1": { + "EV4": { + "AM": 4.0, + "NM": 0.6, + "p": 0.3 + }, + "ER": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "IV1": { + "AM": 10.0, + "p": 0.03 + } + }, + "EV4": { + "EMT": { + "AM": 12, + "NM": 1.8, + "p": 0.3 + }, + "EV1": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "IV4": { + "AM": 20, + "p": 0.0225 + } + }, + "EMT": { + "EV4": { + "AM": 0, + "NM": 0, + "p": 0 + }, + "IMT": { + "AM": 20, + "p": 0.0225 + } + } }, - "sim": { - "duration": 500000, - "dt": 0.6, - "verbose": 0, - "recordStep": 1.0, - "recordStim":0, - "recordWeightStepSize": 1000, - "normalizeWeightStepSize": 50000000000000000000000000, - "normalizeWeightsAtStart": 0, - "RLFakeUpRule": 0, - "RLFakeDownRule": 0, - "RLFakeStayRule": 0, - "name": "20dec21_D0_cycle_reduced_2obj_INTF7_", - "doquit": 1, - "doplot": 0, - "saveCellSecs": 0, - "saveCellConns": 0, - "targettedRL": 1, - "targettedRLOppFctr":0.5, - "anticipatedRL": 0, - "tstepPerAction": 20, - "saveWeights": 1, - "saveAssignedFiringRates": 0, - "useReducedNetwork": 1, - "captureTwoObjs":1 + "EEMWghtThreshMin": 0.9, + "EEMWghtThreshMax": 30, + "EEMPopNorm": 1, + "CellWNorm": { + "On": 0, + "MinFctr": 1.0, + "MaxFctr": 15.0 }, - "architectureVtoA": { - "useProbabilistic": 0, - "useTopological": 0 + "homPlast": { + "On": 0, + "dshift": 0.0, + "mintargetFR": { + "EV1": 0.125, + "EV4": 0.125, + "EMT": 0.125, + "EV1DE": 0.125, + "EV1DW": 0.125, + "EV1DN": 0.125, + "EV1DS": 0.125, + "EV1DSE": 0.125, + "EV1DNE": 0.125, + "EV1DSW": 0.125, + "EV1DNW": 0.125, + "EMUP": 0.125, + "EMDOWN": 0.125 + }, + "maxtargetFR": { + "EV1": 60, + "EV4": 60, + "EMT": 60, + "EV1DE": 60, + "EV1DW": 60, + "EV1DN": 60, + "EV1DS": 60, + "EV1DSE": 60, + "EV1DNE": 60, + "EV1DSW": 60, + "EV1DNW": 60, + "EMUP": 60, + "EMDOWN": 60 + }, + "hsIntervalSteps": 100, + "updateIntervalSteps": 100, + "synType": "AMPA" }, - "architectureVtoM": { - "useProbabilistic": 1, - "useTopological": 0 - }, - "net": { - "EEGain": 1.0, - "EIGain": 1.0, - "IEGain": 1.0, - "IIGain": 1.0, - "ECellModel":"INTF7", - "ICellModel":"INTF7", - "scale": 1, - "allpops": { - "ER":0, - "IR":0, - "EV1":40, - "EV1DE":1, - "EV1DNE":1, - "EV1DN":1, - "EV1DNW":1, - "EV1DW":1, - "EV1DSW":1, - "EV1DS":1, - "EV1DSE":1, - "ID": 0, - "IV1":0, - "EV4":0, - "IV4":0, - "EMT":0, - "IMT":0, - "EA":3200, - "IA":0, - "EA2": 0, - "IA2": 0, - "EMDOWN":300, - "EMUP":300, - "EMSTAY":0, - "IM":150, - "IMUP": 0, - "IMDOWN": 0, - "IMSTAY": 0}, - "ETypes": ["ER","EV1","EV1DE","EV1DNE","EV1DN","EV1DNW","EV1DW","EV1DSW","EV1DS","EV1DSE","EV4","EMT","EMDOWN","EMUP","EMSTAY","EA","EA2"], - "ITypes": ["IR","IV1","IV4","IMT","IM","ID","IMUP","IMDOWN","IMSTAY","IA","IA2"], - "EMotorPops": ["EMDOWN", "EMUP", "EMSTAY"], - "EVPops": ["EV1","EV1DE","EV1DNE","EV1DN","EV1DNW","EV1DW","EV1DSW","EV1DS","EV1DSE","EV4","EMT"], - "EVDirPops": ["EV1DE","EV1DNE","EV1DN","EV1DNW","EV1DW","EV1DSW","EV1DS","EV1DSE"], - "IVDirPops": ["ID"], - "EVLocPops": ["EV1","EV4","EMT"], - "AngRFSigma": 22.5, - "EXPDir": 0, - "VTopoI": 0, - "alltopoldivcons":{ - "IR":{"ER":5}, - "EV1":{"ER":3}, - "IV1":{"EV1":5,"ER":5}, - "EV4":{"EV1":3,"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "IV4":{"EV4":5,"EV1":5}, - "EMT":{"EV4":3,"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "IMT":{"EMT":5,"EV4":5} - }, - "alltopolconvcons":{ - "ER":{"IR":3,"EV1":3,"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1":{"IV1":3,"EV4":3,"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DE":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DNE":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DN":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DNW":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DW":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DSW":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DS":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "EV1DSE":{"EMDOWN":3,"EMUP":3,"EMSTAY":3}, - "IV1":{"IV4":5}, - "EV4":{"IV4":3,"EMT":3}, - "IV4":{"IMT":5}, - "EMT":{"IMT":3} - }, - "STDPconns":{ - "EIPlast":0, - "Visual":0, - "RecurrentDirNeurons":0, - "RecurrentLocNeurons":0, - "FeedForwardDirNtoA":0, - "FeedForwardLocNtoA":0, - "FeedForwardDirNtoM":0, - "FeedForwardLocNtoM":0, - "FeedForwardAtoM":0, - "FeedForwardAtoA2":0, - "FeedForwardA2toM":0, - "FeedbackLocNeurons":0, - "RecurrentMNeurons":0, - "RecurrentANeurons":0, - "RecurrentA2Neurons":0, - "FeedbackAtoDirN":0, - "FeedbackAtoLocN":0, - "FeedbackMtoA":0, - "FeedbackMtoA2":0, - "FeedbackA2toA":0 - }, - "RLconns":{ - "EIPlast":0, - "Visual":0, - "RecurrentDirNeurons":0, - "RecurrentLocNeurons":0, - "FeedForwardDirNtoA":0, - "FeedForwardLocNtoA":0, - "FeedForwardDirNtoM":0, - "FeedForwardLocNtoM":0, - "FeedForwardAtoM":1, - "FeedForwardAtoA2":0, - "FeedForwardA2toM":0, - "FeedbackLocNeurons":0, - "RecurrentMNeurons":0, - "RecurrentANeurons":0, - "RecurrentA2Neurons":0, - "FeedbackAtoDirN":0, - "FeedbackAtoLocN":0, - "FeedbackMtoA":0, - "FeedbackMtoA2":0, - "FeedbackA2toA":0 - }, - "useBinaryImage": 1, - "DirMinRate": 0.0, - "DirMaxRate": 100.0, - "LocMaxRate": 100.0, - "FiringRateCutoff" : 50.0, - "stimModVD": 36.25, - "stimModVL": 36.25, - "cmat": { - "VL":{ - "VD":{"AM":0,"NM":0,"p":0}, - "VL":{"AM":4,"NM":0.6,"p":0}, - "EA":{"AM":12,"NM":0.36,"p":0.1}, - "EMDOWN":{"AM":0.5,"NM":0.001,"p":0.08}, - "EMUP":{"AM":0.5,"NM":0.001,"p":0.08}, - "EMSTAY":{"AM":0.5,"NM":0.001,"p":0.08} - }, - "VD":{ - "VL":{"AM":0,"NM":0,"p":0}, - "VD":{"AM":0,"NM":0,"p":0}, - "EA":{"AM":12,"NM":0.36,"p":0.1}, - "EMDOWN":{"AM":0.5,"NM":0.001,"p":0.08}, - "EMUP":{"AM":0.5,"NM":0.001,"p":0.08}, - "EMSTAY":{"AM":0.5,"NM":0.001,"p":0.08}, - "ID": {"AM":10, "p":0.03} - }, - "EM":{ - "EM":{"AM":1.6,"NM":0.001,"p":0.15}, - "EA":{"AM":0,"NM":0,"p":0.0}, - "IRecip": {"AM":20, "NM":0, "p":0.0625}, - "IM":{"AM":10,"p":0.125} - }, - "EA":{ - "EA":{"AM":1.2,"NM":0.12,"p":0.0}, - "EA2":{"AM":1.2,"NM":0.12,"p":0.2}, - "EM":{"AM":5,"NM":0.001,"p":0.2}, - "IA":{"AM":10, "p":0.1} - }, - "EA2":{ - "EA":{"AM":1.2,"NM":0.12,"p":0.0}, - "EA2":{"AM":1.2,"NM":0.12,"p":0.1}, - "EM":{"AM":1.2,"NM":0.12,"p":0.2}, - "IA2":{"AM": 10, "p":0.0625} - }, - "IR": { - "ER": {"GA": 10, "p":0.0625} - }, - "IV1": { - "EV1": {"GA": 5, "p":0.1}, - "IV1": {"GA":2.5, "p":0.1}, - "ER": {"GA":1.0, "p":0.0}, - "IV4": {"GA":0.375, "p":0.0} - }, - "ID": { - "ED": {"GA": 5, "p":0.1}, - "ID": {"GA":2.5, "p":0.1} - }, - "IV4": { - "EV4": {"GA":10, "p":0.25}, - "IV4": {"GA":2.5, "p":0.25}, - "EV1": {"GA":1.0, "p":0.0}, - "IMT": {"GA":0.375, "p":0.0} - }, - "IMT": { - "EMT": {"GA":10, "p":0.25}, - "IMT": {"GA":2.5, "p":0.25}, - "EV4": {"GA":1.0, "p":0.0} - }, - "IM": { - "EM": {"GA":5, "p":0.25}, - "IM": {"GA":2.5, "p":0.1} - }, - "IMRecip": { - "EM": {"GA":10, "p":0.125} - }, - "IA": { - "EA": {"GA":5, "p":0.1}, - "IA": {"GA":2.5, "p":0.1} - }, - "IA2": { - "EA2": {"GA":5, "p":0.1}, - "IA2": {"GA":2.5, "p":0.15} - }, - "IR": { - "IR": {"GA":2.5, "p":0.15} - }, - "IMUP": { - "IMUP": {"GA":2.5, "p":0.15} - }, - "IMDOWN": { - "IMDOWN": {"GA":2.5, "p":0.15} - }, - "IMSTAY": { - "IMSTAY": {"GA":2.5, "p":0.15} - }, - "ER": { - "EV1": {"AM": 4.0, "NM": 0.6, "p":0.1} - }, - "EV1": { - "EV4": {"AM": 4.0, "NM": 0.6, "p":0.3}, - "ER": {"AM":0 , "NM":0, "p":0}, - "IV1": {"AM":10.0, "p":0.03} - }, - "EV4": { - "EMT": {"AM": 12, "NM": 1.8, "p":0.3}, - "EV1": {"AM":0 , "NM":0, "p":0}, - "IV4": {"AM":20, "p":0.0225} - }, - "EMT": { - "EV4": {"AM":0 , "NM":0, "p":0}, - "IMT": {"AM":20, "p":0.0225} - } - }, - "EEMWghtThreshMin": 0.9, - "EEMWghtThreshMax": 30, - "EEMPopNorm": 1, - "CellWNorm": { - "On": 0, - "MinFctr": 1.0, - "MaxFctr": 15.0 - }, - "homPlast": { - "On":0, - "dshift": 0.0, - "mintargetFR":{"EV1":0.125,"EV4":0.125,"EMT":0.125,"EV1DE":0.125,"EV1DW":0.125,"EV1DN":0.125,"EV1DS":0.125,"EV1DSE":0.125,"EV1DNE":0.125,"EV1DSW":0.125,"EV1DNW":0.125,"EMUP":0.125,"EMDOWN":0.125}, - "maxtargetFR":{"EV1":60,"EV4":60,"EMT":60,"EV1DE":60,"EV1DW":60,"EV1DN":60,"EV1DS":60,"EV1DSE":60,"EV1DNE":60,"EV1DSW":60,"EV1DNW":60,"EMUP":60,"EMDOWN":60}, - "hsIntervalSteps":100, - "updateIntervalSteps":100, - "synType":"AMPA" - }, - "EEMRecProbCross": 0, - "VisualFeedback": 0, - "delayMin": 2, - "delayMax": 5, - "weightVar": 0.5 + "EEMRecProbCross": 0, + "VisualFeedback": 0, + "delayMin": 2, + "delayMax": 5, + "weightVar": 0.5 + }, + "STDP": { + "AMPA": { + "wbase": 1e-06, + "wmax": 0.0004, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 500, + "RLlenanti": 500, + "useRLexp": 1, + "RLhebbwt": 0.0, + "RLantiwt": 0.0, + "hebbwt": 1e-06, + "antiwt": -1e-06, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 }, - "STDP": { - "AMPA": { - "wbase": 1e-06, - "wmax": 0.0004, - "RLon": 0, - "STDPon": 0, - "RLlenhebb": 500, - "RLlenanti": 500, - "useRLexp": 1, - "RLhebbwt": 0.0, - "RLantiwt": 0.0, - "hebbwt": 1e-06, - "antiwt": -1e-06, - "tauhebb": 25, - "tauanti": 25, - "RLwindhebb": 50, - "softthresh": 0, - "verbose": 0 - }, - "NMDA": { - "wbase": 1e-06, - "wmax": 7.5e-05, - "RLon": 0, - "STDPon": 0, - "RLlenhebb": 800, - "RLlenanti": 100, - "useRLexp": 1, - "RLhebbwt": 0.0, - "RLantiwt": -0.0, - "hebbwt": 0, - "antiwt": 0, - "tauhebb": 25, - "tauanti": 25, - "RLwindhebb": 50, - "softthresh": 0, - "verbose": 0 - } + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 800, + "RLlenanti": 100, + "useRLexp": 1, + "RLhebbwt": 0.0, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "RL": { + "AMPAI": { + "wbase": 0.0, + "wmax": 0.1, + "RLon": 1, + "STDPon": 0, + "RLlenhebb": 2000, + "RLlenanti": 2000, + "useRLexp": 1, + "RLhebbwt": 0.0006, + "RLantiwt": -0.0006, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 }, - "RL": { - "AMPAI": { - "wbase": 0.0, - "wmax": 0.1, - "RLon": 1, - "STDPon": 0, - "RLlenhebb": 2000, - "RLlenanti": 2000, - "useRLexp": 1, - "RLhebbwt": 0.0006, - "RLantiwt": -0.0006, - "hebbwt": 0, - "antiwt": 0, - "tauhebb": 10, - "tauanti": 10, - "RLwindhebb": 50, - "softthresh": 0, - "verbose": 0, - "maxreward": 0.0 - }, - "AMPA": { - "wbase": 5, - "wmax": 40, - "RLon": 1, - "STDPon": 0, - "RLlenhebb": 100, - "RLlenanti": 100, - "useRLexp": 1, - "RLhebbwt": 0.1, - "RLantiwt": 0, - "hebbwt": 0.0, - "antiwt": 0.0, - "tauhebb": 10, - "tauanti": 10, - "RLwindhebb": 10, - "softthresh": 0, - "verbose": 0, - "maxreward": 0.0 - }, - "NMDA": { - "wbase": 1e-06, - "wmax": 7.5e-05, - "RLon": 0, - "STDPon": 0, - "RLlenhebb": 1000, - "RLlenanti": 1000, - "useRLexp": 1, - "RLhebbwt": 4e-06, - "RLantiwt": -0.0, - "hebbwt": 0, - "antiwt": 0, - "tauhebb": 10, - "tauanti": 10, - "RLwindhebb": 50, - "softthresh": 0, - "verbose": 0 - } + "AMPA": { + "wbase": 5, + "wmax": 40, + "RLon": 1, + "STDPon": 0, + "RLlenhebb": 100, + "RLlenanti": 100, + "useRLexp": 1, + "RLhebbwt": 0.1, + "RLantiwt": 0, + "hebbwt": 0.0, + "antiwt": 0.0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 10, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 }, - "Noise": { - "I": { - "Rate": 0, - "Weight": 0.5e-05 - }, - "E": { - "Rate": 100, - "Weight": 0 - } + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 1000, + "RLlenanti": 1000, + "useRLexp": 1, + "RLhebbwt": 4e-06, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "Noise": { + "I": { + "Rate": 0, + "Weight": 5e-06 + }, + "E": { + "Rate": 100, + "Weight": 0 } + } } diff --git a/simFull.json b/simFull.json index 81477902..960ad2be 100644 --- a/simFull.json +++ b/simFull.json @@ -32,7 +32,7 @@ "losePoint": 0.0, "followTarget": 0.1, "avoidTarget": -0.01, - "hitBall": 0.2 + "hitBall": 0.5 }, "actionsPerPlay": 1, "followOnlyTowards": 0, @@ -47,28 +47,29 @@ "verbose": 0, "stayStepLim": 0, "simtype": { - "ResumeSim": 0, - "ResumeSimFromFile": "data/20dec7_A0_cycle_synWeights_final.pkl" + "ResumeSim": 1, + "ResumeSimFromFile": "data/21jan5_falcor_RL3_A6__step_2_synWeights_final.pkl" }, "sim": { - "duration": 10000, + "duration": 500000, "dt": 0.6, "verbose": 0, "recordStep": 1.0, "recordStim": 0, - "recordWeightStepSize": 1000, + "recordWeightStepSize": 200, "normalizeWeightStepSize": 50000000000000000000000000000000000000, "normalizeWeightsAtStart": 0, "RLFakeUpRule": 0, "RLFakeDownRule": 0, "RLFakeStayRule": 0, - "name": "20dec21_A0_full_falcor_", + "name": "21jan5_falcor_RL3_A6__step_3_", "doquit": 1, "doplot": 0, "saveCellSecs": 0, "saveCellConns": 0, - "targettedRL": 0, + "targettedRL": 3, "targettedRLOppFctr": 0.5, + "targettedRLDscntFctr": 0.5, "tstepPerAction": 20, "saveWeights": 1, "saveAssignedFiringRates": 0, @@ -82,6 +83,50 @@ "useProbabilistic": 1, "useTopological": 0 }, + "cell": { + "E": {"ahpwt": 1, + "tauahp":400, + "RMP":-65, + "VTH":-40, + "refrac":5, + "Vblock":-25, + "tauAM":10, + "tauNM":300, + "tauGA":10, + "tauGA2":20, + "tauAM2":20, + "tauNM2":300, + "tauRR":8, + "RRWght":0.75}, + "I": {"ahpwt":0.5, + "tauahp":50, + "RMP": -63, + "VTH": -40, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 10, + "tauNM": 300, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 300, + "tauRR": 1.5, + "RRWght": 0.25}, + "IL": {"ahpwt":0.5, + "tauahp":50, + "RMP": -65, + "VTH": -47, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 10, + "tauNM": 300, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 300, + "tauRR": 1.5, + "RRWght": 0.25} + }, "net": { "EEGain": 1.0, "EIGain": 1.0, @@ -108,13 +153,16 @@ "IV4": 0, "EMT": 0, "IMT": 0, - "EA": 2800, - "IA": 1400, - "EA2": 300, - "IA2": 150, + "EA": 1400, + "IA": 0, + "IAL": 0, + "EA2": 1400, + "IA2": 0, + "IA2L": 0, "EMDOWN": 300, "EMUP": 300, - "IM": 300, + "IM": 206, + "IML": 94, "IMUP": 0, "IMDOWN": 0 }, @@ -142,11 +190,14 @@ "IV4", "IMT", "IM", + "IML", "ID", "IMUP", "IMDOWN", "IA", - "IA2" + "IAL", + "IA2", + "IA2L" ], "EMotorPops": [ "EMDOWN", @@ -184,7 +235,7 @@ "EMT" ], "AngRFSigma": 22.5, - "EXPDir": 1, + "EXPDir": 0, "VTopoI": 0, "alltopoldivcons": { "IR": { @@ -311,17 +362,17 @@ "FeedForwardDirNtoM": 0, "FeedForwardLocNtoM": 0, "FeedForwardAtoM": 1, - "FeedForwardAtoA2": 1, + "FeedForwardAtoA2": 0, "FeedForwardA2toM": 1, "FeedbackLocNeurons": 0, - "RecurrentMNeurons": 1, - "RecurrentANeurons": 1, - "RecurrentA2Neurons": 1, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, "FeedbackAtoDirN": 0, "FeedbackAtoLocN": 0, - "FeedbackMtoA": 1, - "FeedbackMtoA2": 1, - "FeedbackA2toA": 1 + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 }, "useBinaryImage": 1, "useNeuronPad": 0, @@ -329,67 +380,82 @@ "DirMaxRate": 150.0, "LocMaxRate": 150.0, "FiringRateCutoff": 50.0, - "stimModVD": 35, - "stimModVL": 35, + "stimModVD": 20, + "stimModVL": 20, "cmat": { - "VL":{"VD":{"AM": 0,"NM": 0, "p": 0}, - "VL":{"AM": 4,"NM": 0.6,"p": 0}, - "EA":{"AM": 5,"NM": 0.26,"p": 0.1}, - "EA2":{"AM": 0.4,"NM": 0.0,"p": 0.0}, - "EMDOWN":{"AM": 0.4,"NM": 0.0,"p": 0.0}, - "EMUP":{"AM": 0.4,"NM": 0.0,"p": 0.0}}, - "VD":{"VL":{"AM": 0,"NM": 0,"p": 0}, - "VD":{"AM": 0,"NM": 0,"p": 0}, - "EA":{"AM": 5,"NM": 0.26,"p": 0.1}, - "EA2":{"AM": 0.4,"NM": 0.0,"p": 0.0}, - "EMDOWN":{"AM": 0.4,"NM": 0.0,"p": 0.0}, - "EMUP":{"AM": 0.4,"NM": 0.0,"p": 0.0}, - "ID":{"AM": 10,"p": 0.03}}, - "EA":{"EA":{"AM": 0.25,"NM": 0.0,"p": 0.005}, - "EA2":{"AM": 1.75,"NM": 0.0,"p": 0.1}, - "EM":{"AM": 1.75,"NM": 0.0,"p": 0.1}, - "IA":{"AM": 10,"p": 0.0325}}, - "EA2":{"EA":{"AM": 0.125,"NM": 0.0,"p": 0.01}, - "EA2":{"AM": 0.5,"NM": 0.0,"p": 0.05}, - "EM":{"AM": 1.75,"NM": 0.0,"p": 0.1}, - "IA2":{"AM": 10,"p": 0.15}}, - "EM":{"EM":{"AM": 0.5,"NM": 0.0,"p": 0.1}, - "EA":{"AM": 0.125,"NM": 0,"p": 0.01}, - "EA2":{"AM": 0.125,"NM": 0,"p": 0.01}, - "IRecip":{"AM": 20,"NM": 0,"p": 0.0625}, - "IM":{"AM": 10,"p": 0.15}}, - "IR":{"IR":{"GA": 1.25,"p": 0.15}}, - "IV1":{"EV1":{"GA": 5,"p": 0.1}, - "IV1":{"GA": 1.25,"p": 0.1}, - "ER":{"GA": 1.0,"p": 0.0}, - "IV4":{"GA": 0.375,"p": 0.0}}, - "ID":{"ED":{"GA": 5,"p": 0.1}, - "ID":{"GA": 1.25,"p": 0.1}}, - "IV4":{"EV4":{"GA":10,"p": 0.25}, - "IV4":{"GA": 1.25,"p": 0.25}, - "EV1":{"GA": 1.0,"p": 0.0}, - "IMT":{"GA": 0.375,"p": 0.0}}, - "IMT":{"EMT":{"GA": 10,"p": 0.25}, - "IMT":{"GA": 1.25,"p": 0.25}, - "EV4":{"GA": 1.0,"p": 0.0}}, - "IM":{"EM":{"GA": 2.5,"p": 0.25}, - "IM":{"GA": 0.625,"p": 0.1}}, - "IMRecip":{"EM": {"GA": 10,"p": 0.125}}, - "IA":{"EA":{"GA": 2.5,"p": 0.054}, - "IA":{"GA": 0.625,"p": 0.022}}, - "IA2":{"EA2":{"GA": 2.5,"p": 0.5}, - "IA2":{"GA": 0.625,"p": 0.2}}, - "IMUP":{"IMUP":{"GA": 1.25,"p": 0.15}}, - "IMDOWN":{"IMDOWN":{"GA": 1.25,"p": 0.15}}, - "ER":{"EV1":{"AM": 4.0,"NM": 0.6,"p": 0.1}}, - "EV1":{"EV4":{"AM": 4.0,"NM": 0.6,"p": 0.3}, - "ER":{"AM": 0,"NM": 0,"p": 0}, - "IV1":{"AM": 10.0,"p": 0.03}}, - "EV4":{"EMT":{"AM": 12,"NM": 1.8,"p": 0.3}, - "EV1":{"AM": 0,"NM": 0,"p": 0}, - "IV4":{"AM": 20,"p": 0.0225}}, - "EMT":{"EV4":{"AM": 0,"NM": 0,"p": 0}, - "IMT":{"AM": 20,"p": 0.0225}} + "VL":{"VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 6,"NM2": 0.1, "conv": 128}, + "EA2":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0.0, "conv": 0}}, + "VD":{"VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 6,"NM2": 0.1, "conv": 8}, + "EA2":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "ID":{"AM2": 0, "conv": 0}}, + "EA":{"EA":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA2":{"AM2": 12.5,"NM2": 0.15, "conv": 30}, + "EM":{"AM2": 12,"NM2": 0.15, "conv": 30}, + "IA":{"AM2": 0,"NM2":0, "conv": 0}, + "IAL":{"AM2": 0,"NM2":0, "conv": 0}}, + "EA2":{"EA":{"AM2": 0,"NM2": 0.0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "EM":{"AM2": 12,"NM2": 0,"conv": 30}, + "IA2":{"AM2": 0,"NM2":0,"conv": 0}, + "IA2L":{"AM2": 0,"NM2":0,"conv": 0}}, + "EM":{"EM":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "IRecip":{"AM2": 0,"NM2": 0,"conv": 0}, + "IM":{"AM2": 10,"NM2":0.0195,"conv": 20}, + "IML":{"AM2": 5,"NM2":0.098,"conv": 20}}, + "IR":{"IR":{"GA": 0,"p": 0}}, + "IV1":{"EV1":{"GA": 0,"p": 0}, + "IV1":{"GA": 0,"p": 0}, + "ER":{"GA": 0,"p": 0}, + "IV4":{"GA": 0,"p": 0}}, + "ID":{"ED":{"GA": 0,"p": 0}, + "ID":{"GA": 0,"p": 0}}, + "IV4":{"EV4":{"GA":0,"p": 0}, + "IV4":{"GA": 0,"p": 0}, + "EV1":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}}, + "IMT":{"EMT":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}, + "EV4":{"GA": 0,"p": 0}}, + "IM":{"EM":{"GA": 9, "conv":22}, + "IM":{"GA": 0, "conv": 31}, + "IML":{"GA": 0, "conv": 17}}, + "IML":{"EM":{"GA2": 2.5, "conv": 8}, + "IM":{"GA2": 0, "conv": 12}, + "IML":{"GA2": 0, "conv": 2}}, + "IMRecip":{"EM": {"GA": 0,"p": 0}}, + "IA":{"EA":{"GA": 0,"conv": 0}, + "IA":{"GA": 0,"conv": 0}, + "IAL":{"GA": 0,"p": 0}}, + "IAL":{"EA":{"GA2": 0,"conv": 0}, + "IA":{"GA2": 0,"conv": 0}, + "IAL":{"GA2": 0,"conv": 0}}, + "IA2":{"EA2":{"GA": 0,"conv": 0}, + "IA2":{"GA": 0,"conv": 0}, + "IA2L":{"GA": 0,"conv": 0}}, + "IA2L":{"EA2":{"GA2": 0,"conv": 0}, + "IA2":{"GA2": 0,"conv": 0}, + "IA2L":{"GA2": 0,"conv": 0}}, + "IMUP":{"IMUP":{"GA": 0,"p": 0}}, + "IMDOWN":{"IMDOWN":{"GA": 0,"p": 0}}, + "ER":{"EV1":{"AM2": 0,"NM2": 0,"p": 0}}, + "EV1":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "ER":{"AM2": 0,"NM2": 0,"p": 0}, + "IV1":{"AM2": 0,"p": 0}}, + "EV4":{"EMT":{"AM2": 0,"NM2": 0,"p": 0}, + "EV1":{"AM2": 0,"NM2": 0,"p": 0}, + "IV4":{"AM2": 0,"p": 0}}, + "EMT":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "IMT":{"AM2": 0,"p": 0}} }, "EEMWghtThreshMin": 0.9, "EEMWghtThreshMax": 4.0, @@ -439,8 +505,10 @@ "EEMRecProbCross": 1, "VisualFeedback": 0, "weightVar": 0.5, - "delayMin": 2, - "delayMax": 4 + "delayMinSoma": 1.8, + "delayMaxSoma": 2.2, + "delayMinDend": 3, + "delayMaxDend": 5 }, "STDP": { "AMPAI": { @@ -502,14 +570,14 @@ }, "RL": { "AMPAI": { - "wbase": 4, - "wmax": 25, - "RLon": 1, + "wbase": 0.1, + "wmax": 9, + "RLon": 0, "STDPon": 0, - "RLlenhebb": 250, - "RLlenanti": 250, - "useRLexp": 1, - "RLhebbwt": 0.5, + "RLlenhebb": 500, + "RLlenanti": 500, + "useRLexp": 0, + "RLhebbwt": 0.0005, "RLantiwt": 0.0, "hebbwt": 0, "antiwt": 0, @@ -521,14 +589,14 @@ "maxreward": 0.0 }, "AMPA": { - "wbase": 0.00001, - "wmax": 16, + "wbase": 5, + "wmax": 20, "RLon": 1, "STDPon": 0, - "RLlenhebb": 250, - "RLlenanti": 250, + "RLlenhebb": 500, + "RLlenanti": 500, "useRLexp": 1, - "RLhebbwt": 0.02, + "RLhebbwt": 0.5, "RLantiwt": 0, "hebbwt": 0.0, "antiwt": 0.0, @@ -558,14 +626,66 @@ "verbose": 0 } }, - "Noise": { - "I": { - "Rate": 0, - "Weight": 0 - }, - "E": { - "Rate": 100, - "Weight": 2.5 - } + "noise": { + "EMDOWN": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 2, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EMUP": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 2, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IM": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IML": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IAL": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA2": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2L": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}} } } diff --git a/simFullHA.json b/simFullHA.json new file mode 100644 index 00000000..a560e945 --- /dev/null +++ b/simFullHA.json @@ -0,0 +1,691 @@ +{ + "env": { + "name": "PongNoFrameskip-v4", + "savemp4": 0 + }, + "moves": { + "UP": 4, + "DOWN": 3, + "NOMOVE": 1 + }, + "movecodes": [ + 4, + 3, + 1 + ], + "useSimulatedEnv": 1, + "simulatedEnvParams": { + "random": 0, + "yball": 80, + "yracket": 40, + "dodraw": 0, + "racket_dy": 5 + }, + "wiggle": 6, + "stochmove": 0, + "0rand": 0, + "movefctr": 1.0, + "avoidStuck": 0, + "useImagePadding": 0, + "rewardcodes": { + "scorePoint": 0.0, + "losePoint": 0.0, + "followTarget": 0.1, + "avoidTarget": -0.01, + "hitBall": 0.5 + }, + "actionsPerPlay": 1, + "followOnlyTowards": 0, + "useRacketPredictedPos": 1, + "useFollowMoveOutput": 0, + "DirectionDetectionAlgo": { + "CentroidTracker": 1, + "OpticFlow": 0, + "FlowWidth": 1, + "UseFull": 1 + }, + "verbose": 0, + "stayStepLim": 0, + "simtype": { + "ResumeSim": 1, + "ResumeSimFromFile": "data/21jan11_falcor_RL3_F6__step_7_synWeights_final.pkl" + }, + "sim": { + "duration": 500000, + "dt": 0.6, + "verbose": 0, + "recordStep": 1.0, + "recordStim": 0, + "recordWeightStepSize": 200, + "normalizeWeightStepSize": 50000000000000000000000000000000000000, + "normalizeWeightsAtStart": 0, + "RLFakeUpRule": 0, + "RLFakeDownRule": 0, + "RLFakeStayRule": 0, + "name": "21jan11_falcor_RL3_F6__step_8_", + "doquit": 1, + "doplot": 0, + "saveCellSecs": 0, + "saveCellConns": 0, + "targettedRL": 3, + "targettedRLOppFctr": 0.5, + "targettedRLDscntFctr": 0.5, + "tstepPerAction": 20, + "saveWeights": 1, + "saveAssignedFiringRates": 0, + "useReducedNetwork": 0 + }, + "architectureVtoA": { + "useProbabilistic": 1, + "useTopological": 0 + }, + "architectureVtoM": { + "useProbabilistic": 1, + "useTopological": 0 + }, + "cell": { + "E": {"ahpwt": 1, + "tauahp":400, + "RMP":-65, + "VTH":-40, + "refrac":5, + "Vblock":-25, + "tauAM":10, + "tauNM":300, + "tauGA":10, + "tauGA2":20, + "tauAM2":20, + "tauNM2":300, + "tauRR":8, + "RRWght":0.75}, + "I": {"ahpwt":0.5, + "tauahp":50, + "RMP": -63, + "VTH": -40, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 10, + "tauNM": 300, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 300, + "tauRR": 1.5, + "RRWght": 0.25}, + "IL": {"ahpwt":0.5, + "tauahp":50, + "RMP": -65, + "VTH": -47, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 10, + "tauNM": 300, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 300, + "tauRR": 1.5, + "RRWght": 0.25} + }, + "net": { + "EEGain": 1.0, + "EIGain": 1.0, + "IEGain": 1.0, + "IIGain": 1.0, + "ECellModel": "INTF7", + "ICellModel": "INTF7", + "scale": 1, + "allpops": { + "ER": 0, + "IR": 0, + "EV1": 6400, + "EV1DE": 400, + "EV1DNE": 400, + "EV1DN": 400, + "EV1DNW": 400, + "EV1DW": 400, + "EV1DSW": 400, + "EV1DS": 400, + "EV1DSE": 400, + "ID": 0, + "IV1": 0, + "EV4": 0, + "IV4": 0, + "EMT": 0, + "IMT": 0, + "EA": 1400, + "IA": 0, + "IAL": 0, + "EA2": 1400, + "IA2": 0, + "IA2L": 0, + "EMDOWN": 300, + "EMUP": 300, + "IM": 206, + "IML": 94, + "IMUP": 0, + "IMDOWN": 0 + }, + "ETypes": [ + "ER", + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT", + "EMDOWN", + "EMUP", + "EA", + "EA2" + ], + "ITypes": [ + "IR", + "IV1", + "IV4", + "IMT", + "IM", + "IML", + "ID", + "IMUP", + "IMDOWN", + "IA", + "IAL", + "IA2", + "IA2L" + ], + "EMotorPops": [ + "EMDOWN", + "EMUP" + ], + "EVPops": [ + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT" + ], + "EVDirPops": [ + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE" + ], + "IVDirPops": [ + "ID" + ], + "EVLocPops": [ + "EV1", + "EV4", + "EMT" + ], + "AngRFSigma": 22.5, + "EXPDir": 0, + "VTopoI": 0, + "alltopoldivcons": { + "IR": { + "ER": 5 + }, + "EV1": { + "ER": 3 + }, + "IV1": { + "EV1": 5, + "ER": 5 + }, + "EV4": { + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "IV4": { + "EV4": 5, + "EV1": 5 + }, + "EMT": { + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "IMT": { + "EMT": 5, + "EV4": 5 + } + }, + "alltopolconvcons": { + "ER": { + "IR": 3, + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1": { + "IV1": 3, + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DNE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DN": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DNW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DSW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DS": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DSE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "IV1": { + "IV4": 5 + }, + "EV4": { + "IV4": 3, + "EMT": 3 + }, + "IV4": { + "IMT": 5 + }, + "EMT": { + "IMT": 3 + } + }, + "STDPconns": { + "EIPlast": 0, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoA2": 0, + "FeedForwardLocNtoA2": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 0, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 0, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 + }, + "RLconns": { + "EIPlast": 1, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoA2": 0, + "FeedForwardLocNtoA2": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 1, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 1, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 + }, + "useBinaryImage": 1, + "useNeuronPad": 0, + "DirMinRate": 0.0, + "DirMaxRate": 150.0, + "LocMaxRate": 150.0, + "FiringRateCutoff": 50.0, + "stimModVD": 20, + "stimModVL": 20, + "cmat": { + "VL":{"VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 6,"NM2": 0.1, "conv": 128}, + "EA2":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0.0, "conv": 0}}, + "VD":{"VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 6,"NM2": 0.1, "conv": 8}, + "EA2":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "ID":{"AM2": 0, "conv": 0}}, + "EA":{"EA":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA2":{"AM2": 12.5,"NM2": 0.15, "conv": 30}, + "EM":{"AM2": 8,"NM2": 0.15, "conv": 300}, + "IA":{"AM2": 0,"NM2":0, "conv": 0}, + "IAL":{"AM2": 0,"NM2":0, "conv": 0}}, + "EA2":{"EA":{"AM2": 0,"NM2": 0.0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "EM":{"AM2": 8,"NM2": 0,"conv": 300}, + "IA2":{"AM2": 0,"NM2":0,"conv": 0}, + "IA2L":{"AM2": 0,"NM2":0,"conv": 0}}, + "EM":{"EM":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "IRecip":{"AM2": 0,"NM2": 0,"conv": 0}, + "IM":{"AM2": 10,"NM2":0.0195,"conv": 20}, + "IML":{"AM2": 5,"NM2":0.098,"conv": 20}}, + "IR":{"IR":{"GA": 0,"p": 0}}, + "IV1":{"EV1":{"GA": 0,"p": 0}, + "IV1":{"GA": 0,"p": 0}, + "ER":{"GA": 0,"p": 0}, + "IV4":{"GA": 0,"p": 0}}, + "ID":{"ED":{"GA": 0,"p": 0}, + "ID":{"GA": 0,"p": 0}}, + "IV4":{"EV4":{"GA":0,"p": 0}, + "IV4":{"GA": 0,"p": 0}, + "EV1":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}}, + "IMT":{"EMT":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}, + "EV4":{"GA": 0,"p": 0}}, + "IM":{"EM":{"GA": 9, "conv":22}, + "IM":{"GA": 0, "conv": 31}, + "IML":{"GA": 0, "conv": 17}}, + "IML":{"EM":{"GA2": 2.5, "conv": 8}, + "IM":{"GA2": 0, "conv": 12}, + "IML":{"GA2": 0, "conv": 2}}, + "IMRecip":{"EM": {"GA": 0,"p": 0}}, + "IA":{"EA":{"GA": 0,"conv": 0}, + "IA":{"GA": 0,"conv": 0}, + "IAL":{"GA": 0,"p": 0}}, + "IAL":{"EA":{"GA2": 0,"conv": 0}, + "IA":{"GA2": 0,"conv": 0}, + "IAL":{"GA2": 0,"conv": 0}}, + "IA2":{"EA2":{"GA": 0,"conv": 0}, + "IA2":{"GA": 0,"conv": 0}, + "IA2L":{"GA": 0,"conv": 0}}, + "IA2L":{"EA2":{"GA2": 0,"conv": 0}, + "IA2":{"GA2": 0,"conv": 0}, + "IA2L":{"GA2": 0,"conv": 0}}, + "IMUP":{"IMUP":{"GA": 0,"p": 0}}, + "IMDOWN":{"IMDOWN":{"GA": 0,"p": 0}}, + "ER":{"EV1":{"AM2": 0,"NM2": 0,"p": 0}}, + "EV1":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "ER":{"AM2": 0,"NM2": 0,"p": 0}, + "IV1":{"AM2": 0,"p": 0}}, + "EV4":{"EMT":{"AM2": 0,"NM2": 0,"p": 0}, + "EV1":{"AM2": 0,"NM2": 0,"p": 0}, + "IV4":{"AM2": 0,"p": 0}}, + "EMT":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "IMT":{"AM2": 0,"p": 0}} + }, + "EEMWghtThreshMin": 0.9, + "EEMWghtThreshMax": 4.0, + "EEMPopNorm": 1, + "CellWNorm": { + "On": 0, + "MinFctr": 1.0, + "MaxFctr": 15.0 + }, + "homPlast": { + "On": 0, + "dshift": 0.0, + "mintargetFR": { + "EV1": 0.125, + "EV4": 0.125, + "EMT": 0.125, + "EV1DE": 0.125, + "EV1DW": 0.125, + "EV1DN": 0.125, + "EV1DS": 0.125, + "EV1DSE": 0.125, + "EV1DNE": 0.125, + "EV1DSW": 0.125, + "EV1DNW": 0.125, + "EMUP": 0.125, + "EMDOWN": 0.125 + }, + "maxtargetFR": { + "EV1": 60, + "EV4": 60, + "EMT": 60, + "EV1DE": 60, + "EV1DW": 60, + "EV1DN": 60, + "EV1DS": 60, + "EV1DSE": 60, + "EV1DNE": 60, + "EV1DSW": 60, + "EV1DNW": 60, + "EMUP": 60, + "EMDOWN": 60 + }, + "hsIntervalSteps": 100, + "updateIntervalSteps": 100, + "synType": "AMPA" + }, + "EEMRecProbCross": 1, + "VisualFeedback": 0, + "weightVar": 0.5, + "delayMinSoma": 1.8, + "delayMaxSoma": 2.2, + "delayMinDend": 3, + "delayMaxDend": 5 + }, + "STDP": { + "AMPAI": { + "wbase": 5, + "wmax": 20, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 250, + "RLlenanti": 250, + "useRLexp": 0, + "RLhebbwt": 0.0, + "RLantiwt": 0.0, + "hebbwt": 0.02, + "antiwt": -0.02, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "AMPA": { + "wbase": 0.001, + "wmax": 16, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 200, + "RLlenanti": 200, + "useRLexp": 0, + "RLhebbwt": 0.0, + "RLantiwt": 0.0, + "hebbwt": 0.02, + "antiwt": -0.02, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 10, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 800, + "RLlenanti": 100, + "useRLexp": 1, + "RLhebbwt": 0.0, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "RL": { + "AMPAI": { + "wbase": 0.1, + "wmax": 9, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 500, + "RLlenanti": 500, + "useRLexp": 0, + "RLhebbwt": 0.0005, + "RLantiwt": 0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "AMPA": { + "wbase": 2, + "wmax": 20, + "RLon": 1, + "STDPon": 0, + "RLlenhebb": 500, + "RLlenanti": 500, + "useRLexp": 1, + "RLhebbwt": 0.5, + "RLantiwt": 0, + "hebbwt": 0.0, + "antiwt": 0.0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 1000, + "RLlenanti": 1000, + "useRLexp": 1, + "RLhebbwt": 4e-06, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "noise": { + "EMDOWN": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 2, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EMUP": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 2, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IM": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IML": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IAL": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA2": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2L": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}} + } +} diff --git a/simReduced.json b/simReduced.json new file mode 100644 index 00000000..4d769449 --- /dev/null +++ b/simReduced.json @@ -0,0 +1,691 @@ +{ + "env": { + "name": "PongNoFrameskip-v4", + "savemp4": 0 + }, + "moves": { + "UP": 4, + "DOWN": 3, + "NOMOVE": 1 + }, + "movecodes": [ + 4, + 3, + 1 + ], + "useSimulatedEnv": 1, + "simulatedEnvParams": { + "random": 0, + "yball": 80, + "yracket": 40, + "dodraw": 0, + "racket_dy": 5 + }, + "wiggle": 6, + "stochmove": 0, + "0rand": 0, + "movefctr": 1.0, + "avoidStuck": 0, + "useImagePadding": 0, + "rewardcodes": { + "scorePoint": 0.0, + "losePoint": 0.0, + "followTarget": 0.1, + "avoidTarget": -0.01, + "hitBall": 0.2 + }, + "actionsPerPlay": 1, + "followOnlyTowards": 0, + "useRacketPredictedPos": 1, + "useFollowMoveOutput": 0, + "DirectionDetectionAlgo": { + "CentroidTracker": 1, + "OpticFlow": 0, + "FlowWidth": 1, + "UseFull": 1 + }, + "verbose": 0, + "stayStepLim": 0, + "simtype": { + "ResumeSim": 0, + "ResumeSimFromFile": "data/20dec7_A0_cycle_synWeights_final.pkl" + }, + "sim": { + "duration": 5000, + "dt": 0.6, + "verbose": 0, + "recordStep": 1.0, + "recordStim": 0, + "recordWeightStepSize": 200, + "normalizeWeightStepSize": 50000000000000000000000000000000000000, + "normalizeWeightsAtStart": 0, + "RLFakeUpRule": 0, + "RLFakeDownRule": 0, + "RLFakeStayRule": 0, + "name": "20dec29_A0_local_", + "doquit": 1, + "doplot": 0, + "saveCellSecs": 0, + "saveCellConns": 0, + "targettedRL": 1, + "targettedRLOppFctr": 0.5, + "anticipatedRL": 0, + "tstepPerAction": 20, + "saveWeights": 1, + "saveAssignedFiringRates": 0, + "useReducedNetwork": 1, + "captureTwoObjs": 1 + }, + "architectureVtoA": { + "useProbabilistic": 0, + "useTopological": 0 + }, + "architectureVtoM": { + "useProbabilistic": 1, + "useTopological": 0 + }, + "cell": { + "E": {"ahpwt": 1, + "tauahp":400, + "RMP":-65, + "VTH":-40, + "refrac":5, + "Vblock":-25, + "tauAM":5.5, + "tauNM":166, + "tauGA":10, + "tauGA2":20, + "tauAM2":20, + "tauNM2":166, + "tauRR":1, + "RRWght":0.25}, + "I": {"ahpwt":0.5, + "tauahp":50, + "RMP": -63, + "VTH": -40, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 5.5, + "tauNM": 166, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 166, + "tauRR": 1, + "RRWght": 0.25}, + "IL": {"ahpwt":0.5, + "tauahp":50, + "RMP": -65, + "VTH": -47, + "refrac": 2.5, + "Vblock": -10, + "tauAM": 10, + "tauNM": 300, + "tauGA": 10, + "tauGA2": 20, + "tauAM2": 20, + "tauNM2": 300, + "tauRR": 1.5, + "RRWght": 0.25} + }, + "net": { + "EEGain": 1.0, + "EIGain": 1.0, + "IEGain": 1.0, + "IIGain": 1.0, + "ECellModel": "INTF7", + "ICellModel": "INTF7", + "scale": 1, + "allpops": { + "ER": 0, + "IR": 0, + "EV1": 40, + "EV1DE": 1, + "EV1DNE": 1, + "EV1DN": 1, + "EV1DNW": 1, + "EV1DW": 1, + "EV1DSW": 1, + "EV1DS": 1, + "EV1DSE": 1, + "ID": 0, + "IV1": 0, + "EV4": 0, + "IV4": 0, + "EMT": 0, + "IMT": 0, + "EA": 3200, + "IA": 0, + "IAL": 0, + "EA2": 0, + "IA2": 0, + "IA2L": 0, + "EMDOWN": 300, + "EMUP": 300, + "IM": 150, + "IML": 0, + "IMUP": 0, + "IMDOWN": 0 + }, + "ETypes": [ + "ER", + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT", + "EMDOWN", + "EMUP", + "EA", + "EA2" + ], + "ITypes": [ + "IR", + "IV1", + "IV4", + "IMT", + "IM", + "IML", + "ID", + "IMUP", + "IMDOWN", + "IA", + "IAL", + "IA2", + "IA2L" + ], + "EMotorPops": [ + "EMDOWN", + "EMUP" + ], + "EVPops": [ + "EV1", + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE", + "EV4", + "EMT" + ], + "EVDirPops": [ + "EV1DE", + "EV1DNE", + "EV1DN", + "EV1DNW", + "EV1DW", + "EV1DSW", + "EV1DS", + "EV1DSE" + ], + "IVDirPops": [ + "ID" + ], + "EVLocPops": [ + "EV1", + "EV4", + "EMT" + ], + "AngRFSigma": 22.5, + "EXPDir": 0, + "VTopoI": 0, + "alltopoldivcons": { + "IR": { + "ER": 5 + }, + "EV1": { + "ER": 3 + }, + "IV1": { + "EV1": 5, + "ER": 5 + }, + "EV4": { + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "IV4": { + "EV4": 5, + "EV1": 5 + }, + "EMT": { + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "IMT": { + "EMT": 5, + "EV4": 5 + } + }, + "alltopolconvcons": { + "ER": { + "IR": 3, + "EV1": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1": { + "IV1": 3, + "EV4": 3, + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DNE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DN": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DNW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DSW": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DS": { + "EMDOWN": 3, + "EMUP": 3 + }, + "EV1DSE": { + "EMDOWN": 3, + "EMUP": 3 + }, + "IV1": { + "IV4": 5 + }, + "EV4": { + "IV4": 3, + "EMT": 3 + }, + "IV4": { + "IMT": 5 + }, + "EMT": { + "IMT": 3 + } + }, + "STDPconns": { + "EIPlast": 0, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoA2": 0, + "FeedForwardLocNtoA2": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 0, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 0, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 + }, + "RLconns": { + "EIPlast": 1, + "Visual": 0, + "RecurrentDirNeurons": 0, + "RecurrentLocNeurons": 0, + "FeedForwardDirNtoA": 0, + "FeedForwardLocNtoA": 0, + "FeedForwardDirNtoA2": 0, + "FeedForwardLocNtoA2": 0, + "FeedForwardDirNtoM": 0, + "FeedForwardLocNtoM": 0, + "FeedForwardAtoM": 1, + "FeedForwardAtoA2": 0, + "FeedForwardA2toM": 0, + "FeedbackLocNeurons": 0, + "RecurrentMNeurons": 0, + "RecurrentANeurons": 0, + "RecurrentA2Neurons": 0, + "FeedbackAtoDirN": 0, + "FeedbackAtoLocN": 0, + "FeedbackMtoA": 0, + "FeedbackMtoA2": 0, + "FeedbackA2toA": 0 + }, + "useBinaryImage": 1, + "useNeuronPad": 0, + "DirMinRate": 0.0, + "DirMaxRate": 100.0, + "LocMaxRate": 100.0, + "FiringRateCutoff": 50.0, + "stimModVD": 36.25, + "stimModVL": 36.25, + "cmat": { + "VL":{"VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 12,"NM2": 0.36, "conv": 0}, + "EA2":{"AM2": 0,"NM2": 0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0, "conv": 0}}, + "VD":{"VL":{"AM2": 0,"NM2": 0, "conv": 0}, + "VD":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA":{"AM2": 12,"NM2": 0.36, "conv": 0}, + "EA2":{"AM2": 0,"NM2": 0, "conv": 0}, + "EMDOWN":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "EMUP":{"AM2": 0,"NM2": 0.0, "conv": 0}, + "ID":{"AM2": 0, "conv": 0}}, + "EA":{"EA":{"AM2": 0,"NM2": 0, "conv": 0}, + "EA2":{"AM2": 0,"NM2": 0, "conv": 0}, + "EM":{"AM2": 7.5,"NM2": 0.001, "p": 0.2}, + "IA":{"AM2": 0,"NM2":0, "conv": 0}, + "IAL":{"AM2": 0,"NM2":0, "conv": 0}}, + "EA2":{"EA":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "EM":{"AM2": 0,"NM2": 0,"conv": 0}, + "IA2":{"AM2": 0,"NM2":0,"conv": 0}, + "IA2L":{"AM2": 0,"NM2":0,"conv": 0}}, + "EM":{"EM":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA":{"AM2": 0,"NM2": 0,"conv": 0}, + "EA2":{"AM2": 0,"NM2": 0,"conv": 0}, + "IRecip":{"AM2": 0,"NM2": 0,"conv": 0}, + "IM":{"AM2": 10,"NM2":0,"p": 0.125}, + "IML":{"AM2": 0,"NM2":0,"conv": 0}}, + "IR":{"IR":{"GA": 0,"p": 0}}, + "IV1":{"EV1":{"GA": 0,"p": 0}, + "IV1":{"GA": 0,"p": 0}, + "ER":{"GA": 0,"p": 0}, + "IV4":{"GA": 0,"p": 0}}, + "ID":{"ED":{"GA": 0,"p": 0}, + "ID":{"GA": 0,"p": 0}}, + "IV4":{"EV4":{"GA":0,"p": 0}, + "IV4":{"GA": 0,"p": 0}, + "EV1":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}}, + "IMT":{"EMT":{"GA": 0,"p": 0}, + "IMT":{"GA": 0,"p": 0}, + "EV4":{"GA": 0,"p": 0}}, + "IM":{"EM":{"GA": 5.0, "p":0.25}, + "IM":{"GA": 0, "conv": 0}, + "IML":{"GA": 0, "conv": 0}}, + "IML":{"EM":{"GA2": 0, "conv": 0}, + "IM":{"GA2": 0, "conv": 0}, + "IML":{"GA2": 0, "conv": 0}}, + "IMRecip":{"EM": {"GA": 0,"p": 0}}, + "IA":{"EA":{"GA": 0,"conv": 0}, + "IA":{"GA": 0,"conv": 0}, + "IAL":{"GA": 0,"p": 0}}, + "IAL":{"EA":{"GA2": 0,"conv": 0}, + "IA":{"GA2": 0,"conv": 0}, + "IAL":{"GA2": 0,"conv": 0}}, + "IA2":{"EA2":{"GA": 0,"conv": 0}, + "IA2":{"GA": 0,"conv": 0}, + "IA2L":{"GA": 0,"conv": 0}}, + "IA2L":{"EA2":{"GA2": 0,"conv": 0}, + "IA2":{"GA2": 0,"conv": 0}, + "IA2L":{"GA2": 0,"conv": 0}}, + "IMUP":{"IMUP":{"GA": 0,"p": 0}}, + "IMDOWN":{"IMDOWN":{"GA": 0,"p": 0}}, + "ER":{"EV1":{"AM2": 0,"NM2": 0,"p": 0}}, + "EV1":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "ER":{"AM2": 0,"NM2": 0,"p": 0}, + "IV1":{"AM2": 0,"p": 0}}, + "EV4":{"EMT":{"AM2": 0,"NM2": 0,"p": 0}, + "EV1":{"AM2": 0,"NM2": 0,"p": 0}, + "IV4":{"AM2": 0,"p": 0}}, + "EMT":{"EV4":{"AM2": 0,"NM2": 0,"p": 0}, + "IMT":{"AM2": 0,"p": 0}} + }, + "EEMWghtThreshMin": 0.9, + "EEMWghtThreshMax": 30.0, + "EEMPopNorm": 1, + "CellWNorm": { + "On": 0, + "MinFctr": 1.0, + "MaxFctr": 15.0 + }, + "homPlast": { + "On": 0, + "dshift": 0.0, + "mintargetFR": { + "EV1": 0.125, + "EV4": 0.125, + "EMT": 0.125, + "EV1DE": 0.125, + "EV1DW": 0.125, + "EV1DN": 0.125, + "EV1DS": 0.125, + "EV1DSE": 0.125, + "EV1DNE": 0.125, + "EV1DSW": 0.125, + "EV1DNW": 0.125, + "EMUP": 0.125, + "EMDOWN": 0.125 + }, + "maxtargetFR": { + "EV1": 60, + "EV4": 60, + "EMT": 60, + "EV1DE": 60, + "EV1DW": 60, + "EV1DN": 60, + "EV1DS": 60, + "EV1DSE": 60, + "EV1DNE": 60, + "EV1DSW": 60, + "EV1DNW": 60, + "EMUP": 60, + "EMDOWN": 60 + }, + "hsIntervalSteps": 100, + "updateIntervalSteps": 100, + "synType": "AMPA" + }, + "EEMRecProbCross": 0, + "VisualFeedback": 0, + "weightVar": 0.5, + "delayMinSoma": 1.8, + "delayMaxSoma": 2.2, + "delayMinDend": 3, + "delayMaxDend": 5 + }, + "STDP": { + "AMPAI": { + "wbase": 5, + "wmax": 20, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 250, + "RLlenanti": 250, + "useRLexp": 0, + "RLhebbwt": 0.0, + "RLantiwt": 0.0, + "hebbwt": 0.02, + "antiwt": -0.02, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "AMPA": { + "wbase": 1e-06, + "wmax": 0.0004, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 500, + "RLlenanti": 500, + "useRLexp": 1, + "RLhebbwt": 0.0, + "RLantiwt": 0.0, + "hebbwt": 1e-06, + "antiwt": -1e-06, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + }, + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 800, + "RLlenanti": 100, + "useRLexp": 1, + "RLhebbwt": 0.0, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 25, + "tauanti": 25, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "RL": { + "AMPAI": { + "wbase": 0.0, + "wmax": 0.1, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 2000, + "RLlenanti": 2000, + "useRLexp": 1, + "RLhebbwt": 0.0006, + "RLantiwt": -0.0006, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "AMPA": { + "wbase": 5, + "wmax": 40, + "RLon": 1, + "STDPon": 0, + "RLlenhebb": 100, + "RLlenanti": 100, + "useRLexp": 1, + "RLhebbwt": 0.1, + "RLantiwt": 0, + "hebbwt": 0.0, + "antiwt": 0.0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 10, + "softthresh": 0, + "verbose": 0, + "maxreward": 0.0 + }, + "NMDA": { + "wbase": 1e-06, + "wmax": 7.5e-05, + "RLon": 0, + "STDPon": 0, + "RLlenhebb": 1000, + "RLlenanti": 1000, + "useRLexp": 1, + "RLhebbwt": 4e-06, + "RLantiwt": -0.0, + "hebbwt": 0, + "antiwt": 0, + "tauhebb": 10, + "tauanti": 10, + "RLwindhebb": 50, + "softthresh": 0, + "verbose": 0 + } + }, + "noise": { + "EMDOWN": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EMUP": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IM": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IML": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IAL": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "EA2": {"AM": {"w":0, "rate":0}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":100}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}}, + "IA2L": {"AM": {"w":0, "rate":100}, + "NM": {"w":0, "rate":0}, + "GA": {"w":0, "rate":0}, + "AM2": {"w": 0, "rate": 200}, + "NM2": {"w": 0, "rate": 0}, + "GA2": {"w": 0, "rate": 100}} + } +} diff --git a/simdat.py b/simdat.py index 374106c4..dce48a0b 100644 --- a/simdat.py +++ b/simdat.py @@ -92,6 +92,16 @@ def generateActivityMap(t1, t2, spkT, spkID, numc, startidx): Nact[t][i][j] = len(cbinSpikes) return Nact +def generateActivityMap1D(t1, t2, spkT, spkID, numc, startidx): + Nact = np.zeros(shape=(len(t1),numc)) # Nact is 2D array of number of spikes, indexed by: time, cellID + for i in range(numc): + cNeuronID = i + startidx + cNeuron_spkT = spkT[spkID==cNeuronID] + for t in range(len(t1)): + cbinSpikes = cNeuron_spkT[(cNeuron_spkT>t1[t]) & (cNeuron_spkT<=t2[t])] + Nact[t][i] = len(cbinSpikes) + return Nact + def getdActMap (totalDur, tstepPerAction, dspkT, dspkID, dnumc, dstartidx,lpop = allpossible_pops): t1 = range(0,totalDur,tstepPerAction) t2 = range(tstepPerAction,totalDur+tstepPerAction,tstepPerAction) @@ -100,7 +110,37 @@ def getdActMap (totalDur, tstepPerAction, dspkT, dspkID, dnumc, dstartidx,lpop = if pop in dnumc and dnumc[pop] > 0: dact[pop] = generateActivityMap(t1, t2, dspkT[pop], dspkID[pop], dnumc[pop], dstartidx[pop]) return dact - + +def getdActMap1D (totalDur, tstepPerAction, dspkT, dspkID, dnumc, dstartidx,lpop = allpossible_pops): + t1 = range(0,totalDur,tstepPerAction) + t2 = range(tstepPerAction,totalDur+tstepPerAction,tstepPerAction) + dact = {} + for pop in lpop: + if pop in dnumc and dnumc[pop] > 0: + dact[pop] = generateActivityMap1D(t1, t2, dspkT[pop], dspkID[pop], dnumc[pop], dstartidx[pop]) + return dact + +def getCumActivityMapForInput(t1,t2,dact1D,lpop): + dCumAct = {} + dStepAct = {} + for pop in lpop: + dCumAct[pop] = [] + dStepAct[pop] = [] + for i in range(len(t1)): + cPopAct = list(np.sum(dact1D[pop][t1[i]:t2[i]+1,:],0)) + cPopStepAct = list(dact1D[pop][t1[i]:t2[i]+1,:]) + dCumAct[pop].append(cPopAct) + dStepAct[pop].append(cPopStepAct) + return dCumAct, dStepAct + +def getRewardsPerSeq(actreward, seqBegs, seqEnds): + rewards = [] + hitsMiss = [] + for i in range(len(seqBegs)): + rewards.append(list(actreward.reward)[seqBegs[i]:seqEnds[i]+1]) + hitsMiss.append(list(actreward.hit)[seqBegs[i]:seqEnds[i]+1]) + return rewards,hitsMiss + def loadsimdat (name=None,getactmap=True,lpop = allpossible_pops): # load simulation data global totalDur, tstepPerAction name = getsimname(name) @@ -772,6 +812,34 @@ def getconcatactionreward (lfn): pda = pda.append(acl) return pda +def getconcatactivity(lfn, lpop = allpossible_pops): + # CAUTION: this function assumes that the simConfig['simData']['spkid'] are preserved across the steps + spkIDs = [] + spkTs = [] + t_lastSim = 0 + for fn in lfn: + conf.dconf = conf.readconf('backupcfg/'+fn+'sim.json') + simConfig = pickle.load(open('data/'+fn+'simConfig.pkl','rb')) + spkT = np.add(simConfig['simData']['spkt'],t_lastSim) + spkID = np.array(simConfig['simData']['spkid']) + for i in range(len(spkT)): + spkTs.append(spkT[i]) + spkIDs.append(spkID[i]) + totalDur = int(dconf['sim']['duration']) + t_lastSim = t_lastSim + totalDur + dstartidx, dendidx = {},{} + for p in lpop: + dstartidx[p] = simConfig['net']['pops'][p]['cellGids'][0] + dendidx[p] = simConfig['net']['pops'][p]['cellGids'][-1] + dspkID,dspkT = {},{} + spkIDs = np.array(spkIDs) + spkTs = np.array(spkTs) + for pop in lpop: + dspkID[pop] = spkIDs[(spkIDs>=dstartidx[pop])&(spkIDs<=dendidx[pop])] + dspkT[pop] = spkTs[(spkIDs>=dstartidx[pop])&(spkIDs<=dendidx[pop])] + return dspkID, dspkT, t_lastSim + + def getindivactionreward (lfn): # get the individual actionreward data frames separately so can compare cumulative rewards,actions,etc. # lfn is a list of actionrewards filenames from the simulation or list of simulation names @@ -1566,6 +1634,161 @@ def plotConns(prepop,postpop): ax.set_zticklabels([postpop,prepop]) plt.show() + +def breakdownPerformance(InputImages,actreward,cend,sthresh,nbframeThresh): + cend1= cend # 16 + cend2= cend+1 # 17 + ballThresh = 250 # its 255 + potential_seqEnds = [] + potential_seqBegs = [] + p0 = np.unique(np.where(InputImages[:,:,0]>ballThresh)[0]) + p1 = np.unique(np.where(InputImages[:,:,1]>ballThresh)[0]) + p = list(p0)+list(p1) + p = np.unique(p) + diff = np.subtract(p[1:],p[0:-1]) + potential_frames = np.add(np.where(diff>nbframeThresh),1) # was 20 here ...for reduced model + seqBegs=[p[0]] + for ind in potential_frames[0]: + seqBegs.append(p[ind]) + seqBegs = list(np.sort(seqBegs)) + seqEnds = [] + IncompleteSeqs = [] + for seqBeg in seqBegs: + ball_near_player = 0 + cInds = seqBeg + while ball_near_player==0 and cInds+10: + for ind in IncompleteSeqs: + seqBegs.remove(ind) + summed_Seqs = np.zeros((len(seqBegs),InputImages.shape[1],InputImages.shape[2])) + for inds in range(len(seqEnds)): + summed_Seqs[inds,:,:]=np.sum(InputImages[seqBegs[inds]:seqEnds[inds]+1,:,:],0) + # now find similar sequences + corrs_all = np.zeros((summed_Seqs.shape[0],summed_Seqs.shape[0])) + pvals_all = np.zeros((summed_Seqs.shape[0],summed_Seqs.shape[0])) + for i in range(summed_Seqs.shape[0]): + x = summed_Seqs[i,:,0:cend2] + for j in range(i,summed_Seqs.shape[0]): + y = summed_Seqs[j,:,0:cend2] + corr, p_value = pearsonr(x.flat, y.flat) + corrs_all[i,j]=corr + pvals_all[i,j]=p_value + lSimilarSeqs = [] + NBoccur = np.zeros((1,summed_Seqs.shape[0])) + for i in range(summed_Seqs.shape[0]): + alreadyExists = 0 + for seqs in lSimilarSeqs: + if i in seqs: alreadyExists=1 + if alreadyExists==0: + lseqs = list(np.where(corrs_all[i,:]>0.9)[0]) + else: + lseqs = [] + lSimilarSeqs.append(lseqs) + NBoccur[0,i] = len(lseqs) + seqs2plot = np.where(NBoccur[0]>sthresh)[0] + if len(seqBegs)>len(seqEnds): + seqBegs = seqBegs[0:len(seqEnds)] + return lSimilarSeqs, seqs2plot, seqBegs, seqEnds + +def displayPerformaceBreakdown(InputImages, actreward, seqs2plot, lSimilarSeqs, seqBegs, seqEnds_wrtRewards): + fig, axs = plt.subplots(6, 6, figsize=(14,12)); + lax = axs.ravel() + i = 0 + for seqNB in seqs2plot: + totalRepeats = len(lSimilarSeqs[seqNB]) + Scores = [] + totalInput = np.zeros((InputImages[0].shape[0],InputImages[0].shape[1])) + for rep in lSimilarSeqs[seqNB]: + cInput = np.sum(InputImages[seqBegs[rep]:seqEnds_wrtRewards[rep]+1,:,:],0) + totalInput = np.add(totalInput,cInput) + Scores.append(list(actreward['hit'])[seqEnds_wrtRewards[rep]]) + lax[i].imshow(totalInput) + lax[i].axis('off') + i+=1 + lax[i].plot(Scores,'b-o') + lax[i].set_ylim((-1.1,1.1)) + i+=1 + +def getconcatactioninputs (lfn): + # concatenate the InputImages data frames together so can look at repeated input patterns. + # lfn is a list of actionrewards filenames from the simulation + pdimg = None + for fn in lfn: + cfInputImages = loadInputImages(fn) + if pdimg is None: + pdimg = cfInputImages + else: + pdimg = np.concatenate((pdimg,cfInputImages),axis=0) + return pdimg + +def plotSeqPerf(lSimilarSeqs,seqs2plot,seqsBegs,seqsEnds,InputImages,dCumAct,hitsMiss,seqNB,plotact=False): + if plotact: + fig,axs = plt.subplots(2,2,figsize=(6,6)) + else: + fig,axs = plt.subplots(2,1,figsize=(4,6)) + lax=axs.ravel() + cseqInds = lSimilarSeqs[seqs2plot[seqNB]] + cseqInput = np.zeros(shape=(len(cseqInds),InputImages.shape[1],InputImages.shape[2])) + for j in range(len(cseqInds)): + cseqInput[j,:,:] = np.sum(InputImages[seqsBegs[cseqInds[j]]:seqsEnds[cseqInds[j]],:,:],0) + lax[0].imshow(np.sum(cseqInput,0)) + lax[0].set_yticks([]) + lax[0].set_xticks([]) + cseq_cumact_up = np.array(dCumAct['EMUP'])[cseqInds,:] + cseq_cumact_down = np.array(dCumAct['EMDOWN'])[cseqInds,:] + goodInds = np.where(cseq_cumact_up[:,0]