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
  • /
  • observables.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:a0a76ce320e66717dd46d7f7d73710dfd7e278f3
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
observables.m
function [obs loss] = observables(num_odors,Nexc,Ninh,dt,spikecount_E,spikecount_I,g_oed,g_ed,g_ied)
%calculate

% firing rates
FR=zeros(num_odors,Nexc);
FRs=zeros(num_odors,Nexc);
FRI=zeros(num_odors,Ninh);
mfr_o=zeros(num_odors,1);
mfrs_o=zeros(num_odors,1);
mfri_o=zeros(num_odors,1);
for oo=1:num_odors
    times(:,oo)=[1000/dt+3000/dt*(oo-1);2500/dt+3000/dt*(oo-1)];
    times_s(:,oo)=[1+3000/dt*(oo-1);1000/dt+3000/dt*(oo-1)];
    times_1(:,oo)=[1000+3000*(oo-1);2500+3000*(oo-1)];
end
for i=1:num_odors
    spikeE_temp=sort(spikecount_E((spikecount_E(:,1)>times(1,i)) & (spikecount_E(:,1)<times(2,i)),2));
    spikes_temp=sort(spikecount_E((spikecount_E(:,1)>times_s(1,i)) & (spikecount_E(:,1)<times_s(2,i)),2));
    spikeI_temp=sort(spikecount_I((spikecount_I(:,1)>times(1,i)) & (spikecount_I(:,1)<times(2,i)),2));
    if ~isempty(spikeE_temp)
        [NspikE,EdspikE]=histcounts(spikeE_temp,'BinMethod','integers');
        FR(i,round(EdspikE(1)):floor(EdspikE(length(EdspikE))))=NspikE/(times(2,i)-times(1,i))/dt*1000;
        mfr_o(i)=mean(FR(i,:));
    end
    if ~isempty(spikes_temp)
        [Nspiks,Edspiks]=histcounts(spikes_temp,'BinMethod','integers');
        FRs(i,round(Edspiks(1)):floor(Edspiks(length(Edspiks))))=Nspiks/(times_s(2,i)-times_s(1,i))/dt*1000;
        mfrs_o(i)=mean(FRs(i,:));
    end
    if ~isempty(spikeI_temp)
        [NspikIb,EdspikIb]=histcounts(spikeI_temp,'BinMethod','integers');
        FRI(i,round(EdspikIb(1)):floor(EdspikIb(length(EdspikIb))))=NspikIb/(times(2,i)-times(1,i))/dt*1000;
        mfri_o(i)=mean(FRI(i,:));
%          mfri_o1(i)=mean(FRI(i,1:500));
%           mfri_o2(i)=mean(FRI(i,501:1000));
    end
    clear spikeE_temp spikeI_temp
end
mfr=mean(mfr_o);
std_fr=std(mfr_o);
mfr_s=mean(mfrs_o);
mfr_i=mean(mfri_o);
% mfr_i1=mean(mfri_o1);
% mfr_i2=mean(mfri_o2);

% correlation between odor-evoked activity patterns
for t=1:num_odors
    for tt=1:num_odors
        corr_E(t,tt)=corr(FR(t,:)',FR(tt,:)');
    end
end

CC_1=mean(triu(corr_E,1));
CC_1(CC_1==0)=[];
CC=mean(CC_1);

% gOE, gSyn, percentage of recurrent input
G_aff=g_oed*70;
G_tot=g_ed*70;
G_totI=g_ied*70;
tim=[];
for ave=1:num_odors
    tim=[1+3000*(ave-1):2500+3000*(ave-1)];
    Gaff_av(ave,:,:)=G_aff(tim,:);
    G_tot_av(ave,:,:)=G_tot(tim,:);
    G_totI_av(ave,:,:)=G_totI(tim,:);
    exc_g(ave,:)=mean(G_tot_av(ave,1000:2500,:)-mean(G_tot_av(ave,501:1000,:),2),2);
    inh_g(ave,:)=mean(G_totI_av(ave,1000:2500,:)-mean(G_totI_av(ave,501:1000,:),2));
end

aff_g_norm=mean(mean(mean(Gaff_av(:,1000:2500,:)-mean(G_tot_av(:,501:1000,:),2),2)))/70;
exc_g_norm=mean(mean(exc_g))/70;
inh_g_norm=mean(mean(inh_g))/70;
syn_g=(exc_g_norm+inh_g_norm);
percent_rec=(exc_g_norm-aff_g_norm)/exc_g_norm*100;

obs=[mfr_s mfr mfr_i CC aff_g_norm percent_rec syn_g];
loss=[mfr_s<0.15 0.9<mfr<1.1 -0.15<CC<0.15 0.03<aff_g_norm<0.16 78<percent_rec<90 1<syn_g<9];

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