Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/clairemb90/pDp-model
31 January 2025, 07:21:50 UTC
  • Code
  • Branches (2)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • refs/tags/v1
    No releases to show
  • a1dbbb4
  • /
  • introduce_assemblies.m
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:66864e0667883a3d1da9fb34317516457fa59d3d
origin badgedirectory badge Iframe embedding
swh:1:dir:a1dbbb4767cb8524dbc4d2e1fb2afda19f85229a
origin badgerevision badge
swh:1:rev:ba3557501693c039fc5f91db03ca8e935fda6e84
origin badgesnapshot badge
swh:1:snp:0ef499ae19e77eb321e204b1ea16a6044c904fa5
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: ba3557501693c039fc5f91db03ca8e935fda6e84 authored by clairemb90 on 26 January 2025, 13:02:12 UTC
Add files via upload
Tip revision: ba35575
introduce_assemblies.m
%strength of connections within assemblies, to adjust
pE=25; %number of connections one E assembly neurons receives from other E assembly neurons 
pI=13; %number of connections one E assembly neurons receives from I assembly neurons 
pEI=25; %number of connections one I assembly neurons receives from E assembly neurons (for tuned I, set to 0)

tit=0;

for matlist=1:20
    
    num_pat=15; % number of assemblies (memories), can be changed
    num_exc=100; % E assembly size, can be changed
    num_inh=25; % I assembly size, can be changed
    
    num_ob=150;
    load(strcat('connec_A_',num2str(matlist),'.mat')) %name of the random connectivity matrix
    WE_rand=w_ee;
    WEI_rand=w_ei;
    WIE_rand=w_ie;
    load('odorseqD21_poisson.mat','OBinp') %OB input
    EnsE=[];
    Ee=zeros(num_pat,num_exc);
    pat_inc=1;
    TOT=[1:4000];
    a=1;
    for od=1:num_pat
        
        act_mc=OBinp(od,1:num_ob,1); %activated mitral cells which define odor od (150 cells with the highest firing rate)
        OB=[];
        [E_temp_l1 id_l1]=sort(sum(w_oe(act_mc(1:num_ob),:),1));
        num_conn=E_temp_l1(4000-num_exc+1);
        id_l1=id_l1(E_temp_l1>=num_conn);
        id_l1=id_l1(randperm(length(id_l1)));
        
        Ee(od,:)=id_l1(1:num_exc);
        Eout(od,:)=TOT(~ismember(TOT,Ee(od,:)));
        EnsE=[EnsE;Ee(od,:)'];
        
        for ke=1:length(Ee)
            
            ens_r=find(w_ee(Ee(od,:),Ee(od,ke))>0);
            noens_r=find(w_ee(Eout(od,:),Ee(od,ke))==1);
            if length(ens_r)<pE
                ind_b=[1:num_exc];
                n_l1=randperm(num_exc,round(pE-length(ens_r)));
                w_ee(Ee(od,ind_b(n_l1)),Ee(od,ke))=w_ee(Ee(od,ind_b(n_l1)),Ee(od,ke))+1;
                
                Eeout=Eout(od,:);
                n_l2=randperm(length(noens_r),round(pE-length(ens_r)));
                w_ee(Eeout(noens_r(n_l2)),Ee(od,ke))=0;
            else
                a=a+1;
            end
        end
        pat_inc=pat_inc+1;
        
    end
    clear Eout
    EnsE=unique(EnsE);
    NonEnsE=TOT(~ismember(TOT,EnsE));
    
    EnsI=[];
    Ii=zeros(num_pat,num_inh);
    
    pat_inc=1;
    
    for od=1:num_pat
        
        a=1;
        b=1;
        
        [I_pre id_i]=sort(sum(w_ei(Ee(od,:),:),1));
        
        num_conn_I=I_pre(length(id_i)-num_inh+1);
        id_i=id_i(I_pre>=num_conn_I);
        id_i=id_i(randperm(length(id_i)));
        Ii(od,:)=id_i(1:num_inh);
        TOTI=[1:1000]; %FB
        Iout(od,:)=TOTI(~ismember(TOTI,Ii(od,:)));
        
        EnsI=[EnsI;Ii(od,:)'];
        
        for ke=1:length(Ee)
            ens_rI=find(w_ie(Ii(od,:),Ee(od,ke))>0);
            noens_rI=find(w_ie(Iout(od,:),Ee(od,ke))==1);
            if length(ens_rI)<pI
                ind_bI=[1:num_inh];
                n_l3=randperm(num_inh,round(pI-length(ens_rI)));
                w_ie(Ii(od,ind_bI(n_l3)),Ee(od,ke))=w_ie(Ii(od,ind_bI(n_l3)),Ee(od,ke))+1;
                
                Iiout=Iout(od,:);
                n_l4=randperm(length(noens_rI),round(pI-length(ens_rI)));
                w_ie(Iiout(noens_rI(n_l4)),Ee(od,ke))=0;
            else
                b=b+1;
            end
        end
        
        TOTE=[1:4000];
        Eout(od,:)=TOTE(~ismember(TOTE,Ee(od,:)));
        
        if pEI~=0
            for ki=1:length(Ii)
                
                ens_rI=find(w_ei(Ee(od,:),Ii(od,ki))>0);
                noens_rI=find(w_ei(Eout(od,:),Ii(od,ki))==1);
                
                if length(ens_rI)<pEI
                    n_l3=randperm(length(Ee(od,:)),round(pEI-length(ens_rI)));
                    ind_bE=[1:length(Ee(od,:))];
                    w_ei(Ee(od,ind_bE(n_l3)),Ii(od,ki))=w_ei(Ee(od,ind_bE(n_l3)),Ii(od,ki))+1;
                    
                    Iiout=Eout(od,:);
                    n_l4=randperm(length(noens_rI),round(pEI-length(ens_rI)));
                    w_ei(Iiout(noens_rI(n_l4)),Ii(od,ki))=0;
                end
                
            end
            pat_inc=pat_inc+1;
        end
        
    alpha_od(od)=mean(sum(w_ee(Ee(od,:),Ee(od,:))));
    beta_od(od)=mean(sum(w_ie(Ii(od,:),Ee(od,:))));
    gamma_od(od)=mean(sum(w_ei(Ee(od,:),Ii(od,:))));
    alpha_ref(od)=mean(sum(WE_rand(Ee(od,:),Ee(od,:))));
    beta_ref(od)=mean(sum(WIE_rand(Ii(od,:),Ee(od,:))));
    gamma_ref(od)=mean(sum(WEI_rand(Ee(od,:),Ii(od,:))));
    
    end

    alpha=mean(alpha_od./alpha_ref);
    beta=mean(beta_od./beta_ref);
    gamma=mean(gamma_od./gamma_ref);
    
    save(strcat('connec_A_',num2str(matlist),'_tEI_noA.mat'),'pEI','pI','pE','w_oe','w_oi','w_ie','w_ei','w_ii','w_ee','EnsE','Ee','Ii','EnsI','num_pat','alpha','beta','gamma')
    clearvars -except matlist pE pI pEI tit
    
end

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top