Global error signal guides local optimization in mismatch calculation.
The 2 matches
- [1] § Methods › Data analysis ↔ analyze/vml_Fig2_John.m, lines 187–241 · score 0.58 · fitted GMMs, favor, BIC, pseudo, component, Gaussian
- [2] § Results › Three-factor learning rule optimizes prediction-error computation ↔ scripts/class_main_nPE_perturbe.py, lines 13–66 · score 0.50 · anti Hebbian, Hebbian learning, match, training
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 291 lines · 10 KB · no license · 1 match
- clearvars -except agg* proj*
- close all
- %%
- pp=fieldnames(aggregateData);
- iP=1;
- corr_thr=0.02;
- %%
- parameters_main;
- sumIDX=35:45;
- normalization=19:29;
- TP = 1;
- cl=[-.2 .2];
- grayscale=.97;
- pp=fieldnames(aggregateData);
- % ?? for iP=7
- for iP=1
- IDX = aggregateData.(pp{iP}).expType{TP};
- MM = aggregateData.(pp{iP}).avgMM{TP};
- MMR= aggregateData.(pp{iP}).avgMMRandom{TP};
- CM = aggregateData.(pp{iP}).corrM{TP};
- CP = aggregateData.(pp{iP}).corrP{TP};
- FF = aggregateData.(pp{iP}).ROIinfo{TP};
- %MM=MM-MMR;
- mm=mean(MM(meanPost,:))-mean(MM(meanPre,:));
- tmp=aggregateData.(pp{iP}).avgMM{TP}-aggregateData.(pp{iP}).avgMMRandom{TP};
- mm=mean(tmp(meanPost,:))-mean(tmp(meanPre,:));
- FF=FF(:,1);
- for type=0:1
- % type=1;
- figure(type+1)
- %mm=mean(MM(sumIDX,:));
- actIDX=FF>4;
- realP=~isnan(CP);
- realM=~isnan(CM);
- d = -0.6:0.025:0.6;
- MIDX_CT=IDX==type & actIDX & realP & realM;
- aCT=CM(MIDX_CT);
- bCT=CP(MIDX_CT);
- fprintf('Corr: %0.3f',corr(aCT,bCT))
- cCT=mm(MIDX_CT);
- m=length(cCT);
- n = fix(m/2);
- x = n~=(m/2);
- %r = [(0:1:n-1)/n,ones(1,n+x)];
- %g = [(0:1:n-1)/n,ones(1,x),(n-1:-1:0)/n];
- %bl = [ones(1,n+x),(n-1:-1:0)/n];
- r = grayscale*[(0:1:n-1)/n,ones(1,n+x)];
- %r(r<.5)=.5;
- bl = grayscale*[(0:1:n-1)/n,ones(1,x),(n-1:-1:0)/n];
- g = grayscale*[ones(1,n+x),((n-1:-1:0)/n)];
- g(g<.65)=.65;
- cmap = [r(:),g(:),bl(:)];
- [~,sidx]=sort(cCT);
- %cCT(cCT<0)=2*cCT(cCT<0);
- sidx=1:length(cCT);
- % subplot(1,2,1+type)
- hold on
- scatter(bCT(sidx),aCT(sidx),15,cCT(sidx),'filled','MarkerEdgeColor', 'k')
- % Compute angles in radians
- % norm_bCT=bCT(sidx)-mean(bCT(sidx));
- % norm_aCT=aCT(sidx)-mean(aCT(sidx));
- norm_bCT=bCT(sidx);
- norm_aCT=aCT(sidx);
- dist_all= sqrt(norm_bCT.^2+norm_aCT.^2);
- set(gcf, 'Position', [100, 100, 400, 300]); % [x, y, width, height]
- set(gca,'CLim',cl,'XTick',0,'YTick',0)
- colormap(cmap);
- % colorbar
- axis image
- xlim([-.7 .7])
- ylim([-.7 .7])
- hold on
- grid on
- file_name = ['./Figures/' pp{1} '_type_' num2str(type),'_scattor' ]; % Use the first field name for naming
- % Save the figure in different formats
- saveas(gcf, [file_name, '.fig']); % Save as MATLAB .fig file
- saveas(gcf, [file_name, '.svg']); % Save as SVG
- sig_thr=(norm_bCT.^2+norm_aCT.^2)>corr_thr;
- % sig_thr=(norm_bCT.^2+norm_aCT.^2)<corr_thr;
- num_cell=sum(sig_thr);
- norm_aCT_sig=norm_aCT(sig_thr);
- norm_bCT_sig=norm_bCT(sig_thr);
- % theta_corr = atan2(norm_bCT(sig_thr),norm_aCT(sig_thr) );
- theta_corr = atan2(norm_bCT,norm_aCT );
- % figure(666) % Find the optimal threshold.
- % clf
- %
- %
- % % Define more bins for higher resolution
- % num_bins = 50; % Increase number of bins
- % bin_edges = logspace(log10(min(dist_all)), log10(max(dist_all)), num_bins); % Log-spaced bins
- %
- % % Plot histogram
- % histogram(dist_all, 'BinEdges', bin_edges, 'Normalization', 'probability', ...
- % 'FaceColor', 'blue', 'EdgeColor', 'black', 'FaceAlpha', 0.7);
- %
- % set(gca, 'XScale', 'log');
- % ylabel('Probability Density');
- % title('Histogram of distance (Log-Scale X-Axis)');
- %
- % % Set axes properties
- % set(gca, 'FontSize', 12);
- % Adjust angles that are less than -3/4 * pi
- theta_corr(theta_corr < -3/4 * pi) = theta_corr(theta_corr < -3/4 * pi) + 2 * pi;
- % Create figure
- bin_width = pi / 10.0;
- bin_edges = -3 * pi / 4 : bin_width : (5/4 * pi + bin_width); % Define bins
- % Compute weighted histogram manually
- [counts, edges] = histcounts(theta_corr, bin_edges, 'Normalization', 'probability');
- weighted_counts = accumarray(discretize(theta_corr, bin_edges), dist_all, [length(counts), 1], @sum);
- weighted_counts = weighted_counts/sum(weighted_counts) ;
- % Use bin_centers as the "data", weighted by weighted_counts
- bin_centers = (edges(1:end-1) + edges(2:end)) / 2;
- % Initialize pseudo sample container
- theta_pseudo = [];
- sum_pseudo_weight=0;
- sum_weight= sum(dist_all);
- rng(1); % Set seed for reproducibility
- % Loop through each point
- for i = 1:length(theta_corr)
- % Repeat theta_corr(i) 100 times with inclusion probability dist_all(i)
- % if theta_corr(i)/pi-1/4>3/4 || theta_corr(i)/pi-1/4<-3/4
- % continue
- % end
- if theta_corr(i)/pi-1/4>1/2 || theta_corr(i)/pi-1/4<-1/2
- continue
- end
- if dist_all(i)<0.1
- continue
- end
- sum_pseudo_weight=sum_pseudo_weight+dist_all(i);
- n_repeat = sum(rand(1, 200) < dist_all(i)); % Number of times to include this point
- theta_pseudo = [theta_pseudo; repmat(theta_corr(i), n_repeat, 1)];
- end
- % Get BIC scores
- Neff = (sum(dist_all))^2 / sum(dist_all.^2);
- options= statset('MaxIter', 1000);
- gm1 = fitgmdist(theta_pseudo-pi/4, 1, 'RegularizationValue', 1e-5,'Options', options);
- gm2 = fitgmdist(theta_pseudo-pi/4, 2, 'RegularizationValue', 1e-5,'Options', options);
- bic1 = gm1.BIC;
- bic2 = gm2.BIC;
- aic1 = gm1.AIC;
- aic2 = gm2.AIC;
- logL1 = gm1.NegativeLogLikelihood * -1;
- logL2 = gm2.NegativeLogLikelihood * -1;
- k1 = gm1.NumComponents;
- k2 = gm2.NumComponents;
- % bic1 = -2 * logL1 + k1 * log(Neff);
- % bic2 = -2 * logL2 + k2 * log(Neff);
- bic1_eff = -2 * logL1 + k1 * log(Neff);
- bic2_eff = -2 * logL2 + k2 * log(Neff);
- fprintf('BIC (1 comp): %.2f\n', bic1);
- fprintf('BIC (2 comp): %.2f\n', bic2);
- fprintf('AIC (1 comp): %.2f\n', aic1);
- fprintf('AIC (2 comp): %.2f\n', aic2);
- fprintf('BIC eff (1 comp): %.2f\n', bic1_eff);
- fprintf('BIC eff (2 comp): %.2f\n', bic2_eff);
- figure(type+21)
- clf
- histogram(theta_pseudo-pi/4, 'Normalization', 'pdf', 'BinWidth', 0.05);
- set(gcf, 'Position', [200,300,560, 420]); % [left, bottom, width, height]
- hold on;
- xgrid = linspace(min(theta_pseudo-pi/4), max(theta_pseudo-pi/4), 200)';
- y1 = pdf(gm1, xgrid);
- y2 = pdf(gm2, xgrid);
- plot(xgrid, y1, 'r-', 'LineWidth', 2);
- plot(xgrid, y2, 'b-', 'LineWidth', 2);
- % Plot vertical lines at component means
- means1 = gm1.mu;
- means2 = gm2.mu;
- for m = 1:length(means1)
- xline(means1(m), 'r--', 'LineWidth', 1.5);
- end
- for m = 1:length(means2)
- xline(means2(m), 'b--', 'LineWidth', 1.5);
- end
- legend('Data', '1-comp GMM', '2-comp GMM');
- xticks([-pi / 2, 0, pi/2]);
- xticklabels({'-\pi/2', '0', '\pi/2'});
- set(gca, 'FontSize', 18, 'XMinorTick', 'on'); % Adjust font size if needed
- % Add BIC difference in the title
- BIC_diff = gm1.BIC - gm2.BIC; % Positive value favors gm2 (2-component)
- if BIC_diff > 0
- preferred = '2-comp GMM';
- else
- preferred = '1-comp GMM';
- end
- box off
- title(sprintf('Gaussian Mixture Model Fit (ΔBIC = %.2f, Preferred: %s)', BIC_diff, preferred));
- file_name = ['./Figures/' pp{1} '_type_' num2str(type),'_fittedGMM' ]; % Use the first field name for naming
- % Save the figure in different formats
- saveas(gcf, [file_name, '.fig']); % Save as MATLAB .fig file
- saveas(gcf, [file_name, '.svg']); % Save as SVG
- figure(type+11)
- clf
- hold on
- % bar((bin_edges(1:end-1)+bin_edges(2:end))-pi/4, weighted_counts/bin_width, 'FaceColor', 'blue', 'EdgeColor', 'black', 'FaceAlpha', 0.7, 'BarWidth', 1);
- bar(bin_edges(1:end-1)-pi/4+bin_width/2, weighted_counts/bin_width, 'FaceColor', 'blue', 'EdgeColor', 'black', 'FaceAlpha', 0.7, 'BarWidth', 1);
- set(gcf, 'Position', [200,300,300, 225]); % [left, bottom, width, height]
- xgrid=linspace(-pi, pi,200)';
- xgrid_width=2*pi/200;
- y1 = pdf(gm1, xgrid);
- y2 = pdf(gm2, xgrid);
- % y1_norm=y1;
- % y2_norm=y2;
- y1_norm=y1*sum_pseudo_weight/sum_weight;
- y2_norm=y2*sum_pseudo_weight/sum_weight;
- % plot(xgrid, y1_norm, 'k-', 'LineWidth', 2);
- % plot(xgrid, y2_norm, 'r-', 'LineWidth', 2);
- box off
- % % Plot histogram
- % histogram(theta_corr, 'BinEdges', bin_edges, 'Normalization', 'probability', ...
- % 'FaceColor', 'blue', 'EdgeColor', 'black', 'FaceAlpha', 0.7,'Weights',dist_all(sig_thr));
- % Customize x-ticks
- % xticks([-3 * pi / 4, -pi / 4, pi / 4, 3/4 * pi, 5/4 * pi]);
- xticks([-pi, -pi / 2, 0, pi/2, pi]);
- xticklabels({'-\pi', '-\pi/2', '0', '\pi/2', '\pi'});
- % Set axis labels (optional)
- hold off
- % Set axes properties
- set(gca, 'FontSize', 12, 'XMinorTick', 'on'); % Adjust font size if needed
- file_name = ['./Figures/' pp{1} '_type_' num2str(type),'_hist' ]; % Use the first field name for naming
- % Save the figure in different formats
- saveas(gcf, [file_name, '.fig']); % Save as MATLAB .fig file
- saveas(gcf, [file_name, '.svg']); % Save as SVG
- % Save raw data to .mat file
- % file_name = ['./Figures/' pp{1} '_type_' num2str(type) ]; % Use the first field name for naming
- % save([file_name, '_data.mat'], 'bCT', 'aCT');
- end
- end
- % % Silverman test.
- % [p, h_crit, h_boot] = silverman_test(theta_pseudo, dist_all,200);
- %
- % % Optional: visualize bootstrap distribution of critical bandwidths
- % figure;
- % histogram(h_boot, 'Normalization', 'pdf');
- % hold on;
- % xline(h_crit, 'r--', 'LineWidth', 2);
- % xlabel('Critical Bandwidth');
- % ylabel('PDF');
- % title(sprintf("Silverman's Test p = %.3f", p));
vml_Fig2_John.m at commit aac6733, no license · at the source
Overview
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
johnhongyumeng/DuetPredictiveCoding_Plasticity
aac67332eb4b7b0bfe459ff72d610b560b2eab64, 28 January 2026Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
23 files
- analyze/
vml_Fig2_John.m , MATLAB, 291 lines, 1 match - lib/
AnalysisTool.py , Python, 3,742 lines - lib/
basic_functions.py , Python, 317 lines - lib/
data_structure.py , Python, 72 lines - lib/
parameters_tuningcurve.p , Python, 175 linesy - lib/
update_functions.py , Python, 206 lines - scripts/
Main_ReLUToy.py , Python, 388 lines - scripts/
Plasticity/ , Python, 149 linesload_analysis_plasticity .py - scripts/
Plasticity/ , Python, 194 linesload_analysis_plasticity _selectivity.py - scripts/
Plasticity/ , Python, 997 linesmain_plasticity_selectiv ity.py - scripts/
Plasticity/ , Python, 916 linesmain_plasticity_selectiv ity_sameIS.py - scripts/
Plasticity/ , Python, 916 linesmain_plasticity_variatio ns.py - scripts/
Plasticity/ , Python, 925 linesmain_plasticity_variatio ns_binaryC.py - scripts/
SingleCellRate/ , Python, 122 linesLoopCondForRate.py - scripts/
SingleCellRate/ , Python, 123 linesLoopDendForRate.py - scripts/
SingleCellRate/ , Python, 120 linesLoopInjForRate.py - scripts/
SingleCellRate/ , Python, 179 linesRatePyr.py - scripts/
SingleCellRate/ , Python, 123 linesTestSEDIForRate.py - scripts/
class_main_nPE_perturbe. , Python, 1,342 lines, 1 matchpy - scripts/
nPEcorrelation/ , Python, 857 linesmain_selectivity.py - scripts/
shell_main_nPE.py , Python, 110 lines - scripts/
shell_main_pPE.py , Python, 107 lines - README.md, Text, 48 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: johnhongyumeng/
DuetPredictiveCoding_Pla sticity
Read it in the paper: doi.org/10.1038/s41467-026-70354-x.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 22 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: johnhongyumeng/
DuetPredictiveCoding_Pla sticity
Read it in the paper: doi.org/10.1038/s41467-026-70354-x.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 3 keywords, 7 MeSH terms, 2 funders, 73 references.
Cite
This paper
Meng, J. H., & Wang, X.-J. (2026). Global error signal guides local optimization in mismatch calculation. Nature communications, 17(1), 3868. https://
BibTeX
@article{meng2026global,
author = {Meng, John Hongyu and Wang, Xiao-Jing},
title = {{Global error signal guides local optimization in mismatch calculation}},
journal = {Nature communications},
year = {2026},
month = mar,
volume = {17},
number = {1},
pages = {3868},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {41820382},
pmcid = {PMC13125295}
}
RIS
TY - JOUR
AU - Meng, John Hongyu
AU - Wang, Xiao-Jing
TI - Global error signal guides local optimization in mismatch calculation
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 3868
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Global error signal guides local optimization in mismatch calculation",
"container-title": "Nature communications",
"author": [
{
"family": "Meng",
"given": "John Hongyu"
},
{
"family": "Wang",
"given": "Xiao-Jing"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "3868",
"DOI": "10.1038/
"PMID": "41820382",
"PMCID": "PMC13125295",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
12
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41467-026-70347-w [code]
- Desegregation of neuronal predictive processing.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, computational modeling (no new data), 16 references
- [2] doi:10.1371/journal.pcbi.1014164 [code]
- 'Backpropagation and the brain' realized in cortical error neuron microcircuits.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 10 references
- [3] doi:10.1126/sciadv.aed6417 [code]
- Intrinsic timing, not temporal prediction, underlies ramping dynamics in visual and parietal cortex during passive behavior.Journal: Science advancesIn common: seaborn, scikit-learn, SciPy, 2 other tools, mouse, 6 references
- [4] doi:10.64898/2026.03.03.705098
- Spiking and neuromodulation during active experience shape visuomotor integration in V1 layer 2/
3 neurons Journal: bioRxiv (preprint)In common: 8 references - [5] doi:10.1371/journal.pone.0354021 [code]
- A genetic algorithm for self-supervised models of oscillatory neurodynamics.Journal: PloS oneIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 6 references
- [6] doi:10.7554/elife.105953 [code]
- Top-down feedback in deep neural networks leads to functional differences during audiovisual integration.Journal: eLifeIn common: seaborn, scikit-learn, SciPy, 2 other tools, 5 references
- [7] doi:10.1038/s41467-026-74460-8 [code]
- Spike-based alignment learning solves the weight transport problem.Journal: Nature communicationsIn common: Numba, seaborn, scikit-learn, 3 other tools, computational modeling (no new data), 3 references
- [8] doi:10.1523/jneurosci.0987-25.2026 [code]
- Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: Numba, seaborn, SciPy, 2 other tools, 4 references
- [9] doi:10.1371/journal.pbio.3003915 [code]
- Noise-invariant representations of sound emerge along the canonical cortical hierarchy.Journal: PLoS biologyIn common: Numba, Statistics and Machine Learning Toolbox, seaborn, 4 other tools, mouse, 2 references
- [10] doi:10.1371/journal.pcbi.1014001 [code]
- Burst firing creates an attractor in synaptic weight dynamics.Journal: PLoS computational biologyIn common: Statistics and Machine Learning Toolbox, computational modeling (no new data), 5 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 22 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:90831eea5d200f24…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
