Revision 30:1a502830d462 MAP

View differences:

MAP/MAP1_14.m
313 313
% Fiber types are specified in terms of tauCa
314 314
nANfiberTypes= length(IHCpreSynapseParams.tauCa);
315 315
tauCas= IHCpreSynapseParams.tauCa;
316
nChannels= nANfiberTypes*nBFs;
317
synapticCa= zeros(nChannels,segmentLength);
316
nANchannels= nANfiberTypes*nBFs;
317
synapticCa= zeros(nANchannels,segmentLength);
318 318

  
319 319
% Calcium control (more calcium, greater release rate)
320 320
ECa=IHCpreSynapseParams.ECa;
321 321
gamma=IHCpreSynapseParams.gamma;
322 322
beta=IHCpreSynapseParams.beta;
323 323
tauM=IHCpreSynapseParams.tauM;
324
mICa=zeros(nChannels,segmentLength);
324
mICa=zeros(nANchannels,segmentLength);
325 325
GmaxCa=IHCpreSynapseParams.GmaxCa;
326 326
synapse_z= IHCpreSynapseParams.z;
327 327
synapse_power=IHCpreSynapseParams.power;
......
329 329
% tauCa vector is established across channels to allow vectorization
330 330
%  (one tauCa per channel). Do not confuse with tauCas (one pre fiber type)
331 331
tauCa=repmat(tauCas, nBFs,1);
332
tauCa=reshape(tauCa, nChannels, 1);
332
tauCa=reshape(tauCa, nANchannels, 1);
333 333

  
334
% presynapse startup values (vectors, length:nChannels)
334
% presynapse startup values (vectors, length:nANchannels)
335 335
% proportion (0 - 1) of Ca channels open at IHCrestingV
336 336
mICaCurrent=((1+beta^-1 * exp(-gamma*IHCrestingV))^-1)...
337 337
    *ones(nBFs*nANfiberTypes,1);
......
349 349
% The results computed either for probabiities *or* for spikes (not both)
350 350
% Spikes are necessary if CN and IC are to be computed
351 351
nFibersPerChannel= AN_IHCsynapseParams.numFibers;
352
nANfibers= nChannels*nFibersPerChannel;
352
nANfibers= nANchannels*nFibersPerChannel;
353 353
AN_refractory_period= AN_IHCsynapseParams.refractory_period;
354 354

  
355 355
y=AN_IHCsynapseParams.y;
......
359 359
M=round(AN_IHCsynapseParams.M);
360 360

  
361 361
% probability            (NB initial 'P' on everything)
362
PAN_ydt = repmat(AN_IHCsynapseParams.y*dt, nChannels,1);
363
PAN_ldt = repmat(AN_IHCsynapseParams.l*dt, nChannels,1);
364
PAN_xdt = repmat(AN_IHCsynapseParams.x*dt, nChannels,1);
365
PAN_rdt = repmat(AN_IHCsynapseParams.r*dt, nChannels,1);
362
PAN_ydt = repmat(AN_IHCsynapseParams.y*dt, nANchannels,1);
363
PAN_ldt = repmat(AN_IHCsynapseParams.l*dt, nANchannels,1);
364
PAN_xdt = repmat(AN_IHCsynapseParams.x*dt, nANchannels,1);
365
PAN_rdt = repmat(AN_IHCsynapseParams.r*dt, nANchannels,1);
366 366
PAN_rdt_plus_ldt = PAN_rdt + PAN_ldt;
367 367
PAN_M=round(AN_IHCsynapseParams.M);
368 368

  
......
371 371
Pavailable    = Pcleft*(l+r)./kt0;
372 372
Preprocess    = Pcleft*r/x; % canbe fractional
373 373

  
374
ANprobability=zeros(nChannels,segmentLength);
375
ANprobRateOutput=zeros(nChannels,signalLength);
374
ANprobability=zeros(nANchannels,segmentLength);
375
ANprobRateOutput=zeros(nANchannels,signalLength);
376 376
lengthAbsRefractoryP= round(AN_refractory_period/dt);
377 377
% special variables for monitoring synaptic cleft (specialists only)
378
savePavailableSeg=zeros(nChannels,segmentLength);
379
savePavailable=zeros(nChannels,signalLength);
378
savePavailableSeg=zeros(nANchannels,segmentLength);
379
savePavailable=zeros(nANchannels,signalLength);
380 380

  
381 381
% spikes     % !  !  !    ! !        !   !  !
382 382
lengthAbsRefractory= round(AN_refractory_period/ANdt);
......
406 406
%% CN (first brain stem nucleus - could be any subdivision of CN)
407 407
% Input to a CN neuorn is a random selection of AN fibers within a channel
408 408
%  The number of AN fibers used is ANfibersFanInToCN
409
ANfibersFanInToCN=MacGregorMultiParams.fibersPerNeuron;
410
nCNneuronsPerChannel=MacGregorMultiParams.nNeuronsPerBF;
411 409
% CNtauGk (Potassium time constant) determines the rate of firing of
412 410
%  the unit when driven hard by a DC input (not normally >350 sp/s)
413
CNtauGk=MacGregorMultiParams.tauGk;
411
% If there is more than one value, everything is replicated accordingly
412

  
414 413
ANavailableFibersPerChan=AN_IHCsynapseParams.numFibers;
415
nCNneurons=nCNneuronsPerChannel*nChannels;
416
% nCNneuronsPerFiberType= nCNneurons/nANfiberTypes;
414
ANfibersFanInToCN=MacGregorMultiParams.fibersPerNeuron;
417 415

  
416
CNtauGk=MacGregorMultiParams.tauGk; % row vector of CN types (by tauGk)
417
nCNtauGk=length(CNtauGk);
418

  
419
% the total number of 'channels' is now greater
420
nCNchannels=nANchannels*nCNtauGk;
421

  
422
nCNneuronsPerChannel=MacGregorMultiParams.nNeuronsPerBF;
423
tauGk=repmat(CNtauGk, nCNneuronsPerChannel,1);
424
tauGk=reshape(tauGk,nCNneuronsPerChannel*nCNtauGk,1);
425

  
426
% Now the number of neurons has been increased
427
nCNneurons=nCNneuronsPerChannel*nCNchannels;
418 428
CNmembranePotential=zeros(nCNneurons,reducedSegmentLength);
419 429

  
420 430
% establish which ANfibers (by name) feed into which CN nuerons
421
CNinputfiberLists=zeros(nChannels*nCNneuronsPerChannel, ANfibersFanInToCN);
431
CNinputfiberLists=zeros(nANchannels*nCNneuronsPerChannel, ANfibersFanInToCN);
422 432
unitNo=1;
423
for ch=1:nChannels
433
for ch=1:nANchannels
424 434
    % Each channel contains a number of units =length(listOfFanInValues)
425 435
    for idx=1:nCNneuronsPerChannel
426
        fibersUsed=(ch-1)*ANavailableFibersPerChan + ...
427
            ceil(rand(1,ANfibersFanInToCN)* ANavailableFibersPerChan);
428
        CNinputfiberLists(unitNo,:)=fibersUsed;
429
        unitNo=unitNo+1;
436
        for idx2=1:nCNtauGk
437
            fibersUsed=(ch-1)*ANavailableFibersPerChan + ...
438
                ceil(rand(1,ANfibersFanInToCN)* ANavailableFibersPerChan);
439
            CNinputfiberLists(unitNo,:)=fibersUsed;
440
            unitNo=unitNo+1;
441
        end
430 442
    end
431 443
end
432 444

  
......
468 480
CNtimeSinceLastSpike=zeros(nCNneurons,1);
469 481
% tauGk is the main distinction between neurons
470 482
%  in fact they are all the same in the standard model
471
tauGk=repmat(CNtauGk,nChannels*nCNneuronsPerChannel,1);
483
tauGk=repmat(tauGk,nANchannels,1);
472 484

  
473
CN_PSTH=zeros(nChannels,reducedSegmentLength);
474 485
CNoutput=false(nCNneurons,reducedSignalLength);
475 486

  
476 487

  
477 488
%% MacGregor (IC - second nucleus) --------
478
nICcells=nChannels;  % one cell per channel
489
nICcells=nANchannels*nCNtauGk;  % one cell per channel
490
CN_PSTH=zeros(nICcells ,reducedSegmentLength);
479 491

  
480 492
ICspikeWidth=0.00015;   % this may need revisiting
481 493
epochsPerSpike=round(ICspikeWidth/ANdt);
......
515 527
ICtrailingAlphas=zeros(nICcells, length(IC_CNalphaFunction));
516 528

  
517 529
ICfiberTypeRates=zeros(nANfiberTypes,reducedSignalLength);
518
ICoutput=false(nChannels,reducedSignalLength);
530
ICoutput=false(nICcells,reducedSignalLength);
519 531

  
520 532
ICmembranePotential=zeros(nICcells,reducedSegmentLength);
521 533
ICmembraneOutput=zeros(nICcells,signalLength);
......
799 811
                % releaseProb is the release probability per channel
800 812
                %  but each channel has many synapses
801 813
                releaseProb=repmat(releaseProb',nFibersPerChannel,1);
802
                releaseProb=reshape(releaseProb, nFibersPerChannel*nChannels,1);
814
                releaseProb=reshape(releaseProb, nFibersPerChannel*nANchannels,1);
803 815

  
804 816
                % AN_available=round(AN_available); % vesicles must be integer, (?needed)
805 817
                M_q=AN_M- AN_available;     % number of missing vesicles
......
883 895
            % Create the dendritic current for that neuron
884 896
            % First get input spikes to this neuron
885 897
            synapseNo=1;
886
            for ch=1:nChannels
898
            for ch=1:nCNchannels
887 899
                for idx=1:nCNneuronsPerChannel
888 900
                    % determine candidate fibers for this unit
889 901
                    fibersUsed=CNinputfiberLists(synapseNo,:);
......
992 1004
            %% IC ----------------------------------------------
993 1005
                %  MacGregor or some other second order neurons
994 1006

  
995
                % combine CN neurons in same channel, i.e. same BF & same tauCa
1007
                % combine CN neurons in same channel, 
1008
                %  i.e. same BF & same tauCa
996 1009
                %  to generate inputs to single IC unit
997 1010
                channelNo=0;
998 1011
                for idx=1:nCNneuronsPerChannel:nCNneurons-nCNneuronsPerChannel+1;

Also available in: Unified diff