OSCR

Compressive learning scaffolds higher-order network structure to enhance human knowledge acquisition.

Code ↔ Paper

11 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 11 matches · 3 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › Time-resolved mouse trajectory analysis ↔ Code/Fig2andSI/Fig2andSI.m, lines 15–40 · score 0.78 · distractor angle, mouse trajectory, target angle, binary classifier, incorrect, position
  2. [2] § Methods › Time-resolved mouse trajectory analysis ↔ Code/Fig3andSI/Fig3andSI.m, lines 15–40 · score 0.78 · distractor angle, mouse trajectory, target angle, binary classifier, incorrect, position
  3. [3] § Methods › Transition network ↔ Code/Fig1d/HK_network.m, the whole file · a weak match · score 0.71 · Barab si Albert, Scale free network, probability, connected, edges, transition
  4. [4] § Methods › Time-resolved mouse trajectory analysis › Overall accuracy computation ↔ Code/Fig2andSI/Fig2andSI.m, lines 15–40 · score 0.68 · mouse click, hint onset, binary classification, reaction, position
  5. [5] § Methods › Time-resolved mouse trajectory analysis › Overall accuracy computation ↔ Code/Fig3andSI/Fig3andSI.m, lines 15–40 · score 0.68 · mouse click, hint onset, binary classification, reaction, position
  6. [6] § Methods › Network compressibility analysis ↔ Code/Fig1c/Fig1c.m, lines 24–44 · score 0.66 · reconstruction error, adjacency matrix, truncating, MSE, singular, SVD
  7. [7] § Results › Two-stage computational modeling explains compressive learning ↔ Code/Fig5bandSI/FitHypergraphModel.m, the whole file · a weak match · score 0.54 · RandomWalk, LeafToHub, HubToLeaf, hypergraph, fit, model
  8. [8] § Results › Two-stage computational modeling explains compressive learning ↔ Code/Fig5bandSI/Fig5b.m, lines 56–115 · score 0.54 · corrected Akaike Information, AICc, HG, OS, SR, Model
  9. [9] § Results › Two-stage computational modeling explains compressive learning ↔ Code/Fig5bandSI/FitHypergraphModel.m, the whole file · a weak match · score 0.54 · Hypergraph model, LeafToHub, random walks, HubToLeaf
  10. [10] § Results › Two-stage computational modeling explains compressive learning ↔ Code/Fig5bandSI/Modelfitting_main.m, lines 193–242 · score 0.52 · SR models, hypergraph model, random walk, HG, OS, entropy
  11. [11] § Results › Two-stage computational modeling explains compressive learning ↔ Code/Fig5bandSI/Fig5b.m, lines 216–268 · score 0.51 · SR models, hypergraph model, random walk, HG, OS, entropy

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 · 465 lines · 22 KB · no license · 2 matches

  1. % CompressiveLearningPaper_Figure2.m
  2. % Re-organized by XR @ May 31 2026
  3. % Script for plots in Figure 2
  4. %%
  5. clear
  6. clc
  7. %% add path
  8. % !!!!!!!!!! Please replace the 'folder' with your own path !!!!!!!!!!
  9. folder = '/Volumes/My Passport/HierarchicalCluster';
  10. addpath(genpath(fullfile(folder, 'CompressiveLearningPaper')));
  11. %% parameters
  12. %%% Columns index for the all_data.mat
  13. % columnNames = {'network', 'subjID', 'trialNo', 'blockNo', 'cue', 'target', 'distractor', ...
  14. % 'target-Xpos', 'target-Ypos', 'distractor-Xpos', 'distractor-Ypos', ...
  15. % 'mouse-Xpos', 'mouse-Ypos', 'mouse-Time', 'mouse-target-Angle', 'mouse-distractor-Angle', ...
  16. % 'choiceId', 'choice-Final', 'clickRT', 'clickChoice', 'clickConds'};
  17. col_network = 1; % 'lattice', 'random', 'smallWorld', 'scaleFree'
  18. col_subjID = 2; % subjID
  19. col_trialNo = 3; % trialNo: 1-1000
  20. col_blockNo = 4; % blockNo: 1-5
  21. col_objCue = 5; % cue node
  22. col_objTgt = 6; % target node
  23. col_objDtr = 7; % distractor node
  24. col_imgPosX_tgt = 8; % x-coordinate of the target during the choice period: (units) 'pixel' for in-lab exp and 'height' for online exp
  25. col_imgPosY_tgt = 9; % y-coordinate of the target during the choice period
  26. col_imgPosX_dtr = 10; % x-coordinate of the distractor
  27. col_imgPosY_dtr = 11; % y-coordinate of the distractor
  28. col_mouseXpos = 12; % mouse trajectory: x-coordinate
  29. col_mouseYpos = 13; % mouse trajectory: y-coordinate
  30. col_mouseTime = 14; % mouse trajectory: sampling time
  31. col_angle_tgt = 15; % mouse-to-target angle
  32. col_angle_dtr = 16; % mouse-to-distractor angle
  33. col_choice_t = 17; % choice (binary classification) at each time point: 1 = correct (choosing target), 0 = incorrect
  34. col_choice_final = 18; % choice per trial before hint onset: 1 = correct (choosing target), 0 = incorrect
  35. col_respRT = 19; % response reaction time (time when the stimulus was clicked)
  36. col_choice_click = 20; % choice based on the mouse click: 0 = correct, 1 = error/timeout (reversed compared to the choice from mouse trajectory)
  37. col_choice_label = 21; % response condition: (1) correct resp before cue: 0; (2) correct resp after cue: 1; (3) incorrect resp before cue: 2; (4) incorrect resp after cue: 3;
  38. %% network
  39. nodeNum = 16; % 16 nodes in each network
  40. measTime = 2; % 2 seconds
  41. nBlock_pred = 5; % prediction task: 5 blocks
  42. trialsBlc_pred = 200;
  43. grayoffT = 0.8;
  44. network_list = {'lattice', 'random', 'smallWorld', 'scaleFree'};
  45. circle_list = 0 : 1/60 : 1.5;
  46. tInBlc = 200 : 200 : 1000;
  47. nBlock = length(tInBlc); %% seperate the total trials into 10 blocks
  48. trialsInBlc = zeros(nBlock, 2);
  49. trialsInBlc(:, 1) = [1, tInBlc(1 : end - 1) + 1]';
  50. trialsInBlc(:, 2) = tInBlc;
  51. %% read the data
  52. codePath = fullfile(folder, 'CompressiveLearningPaper', 'Code', 'Fig2');
  53. load(fullfile(codePath, 'data_Exp1_Figure2.mat'), 'all_data');
  54. %% extract the relevant information for subsequent plot
  55. expMode_subj = {'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', ...
  56. 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', 'offline', ...
  57. 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online', ...
  58. 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online', 'online'};
  59. %%% binary classified choice from the mouse trajectory
  60. nExp = length(network_list);
  61. subLen = length(expMode_subj);
  62. angAcc_exp = nan(subLen, length(circle_list), nExp); %% accuracy in each time point
  63. angAcc_oneHot_exp = nan(subLen, nExp); %% accuracy per trial based on click behaviour: before cue or choice at 0.8 s
  64. angAcc_dgr_oneHot_exp = nan(subLen, 3, nExp); %% 3: (1) degree of fromNode = 4; (2) degree of toNode = 4; (3) both from & to = 4;
  65. dgr_oneHot_N_exp = nan(subLen, 3, nExp); %% trial numbers in each of the matched condition
  66. dgr_oneHot_trlIdx_exp = cell(subLen, 3, nExp);
  67. choiceId_trials_exp = cell(subLen, nExp); %% save the choiceId_trials.mat for each participant in order to do the re-sampling
  68. nBin = 100;
  69. BinL = 1000 / nBin;
  70. angAcc_oneHot_ln_exp = nan(subLen, BinL, nExp); %%% learning effect
  71. %%% click accuracy (overall, before-hint, after-hint)
  72. clickAcc_exp = nan(subLen, 3, nExp); % 3: 1) overall accuracy; 2) before-hint accuracy; 3) after-hint accuracy
  73. for iExp = 1 : nExp
  74. netWord = network_list{iExp};
  75. idx = strcmp(all_data.network, netWord);
  76. clusterResult_iExp = all_data(idx, :);
  77. subjCol = clusterResult_iExp.subjID;
  78. subLen = max(subjCol);
  79. [transMat, nodeDegree] = network_class(netWord);
  80. uniqDgr = unique(nodeDegree);
  81. %% loop across subjects
  82. angAcc = zeros(subLen, length(circle_list)); %% accuracy in each time point
  83. lenData = zeros(subLen, length(circle_list)); %% data length in each time point
  84. angAcc_oneHot = zeros(subLen, 1); %% overall accuracy: before cue or choice at 0.8 s
  85. angAcc_dgr_oneHot = zeros(subLen, 3); %% 3: (1) degree of fromNode = 4; (2) degree of toNode = 4; (3) both from & to = 4;
  86. angAcc_oneHot_ln = nan(subLen, BinL);
  87. for iSub = 1 : subLen
  88. disp([netWord, '-subj', num2str(iSub)]);
  89. expMode = expMode_subj{iSub};
  90. % data from the current participant
  91. clusterResult = clusterResult_iExp(clusterResult_iExp.subjID == iSub, :);
  92. %% data from the clusterResult
  93. nTrials = size(clusterResult, 1);
  94. trials_Col = clusterResult.trialNo;
  95. blockNo_col = clusterResult.blockNo;
  96. respRT_Col = clusterResult.clickRT;
  97. respSig_Col = clusterResult.clickConds;
  98. from_nodes = clusterResult.cue;
  99. to_nodes = clusterResult.target;
  100. dtr_nodes = clusterResult.distractor;
  101. choiceId = cell2mat(clusterResult.choiceId); % nan(length(stim), length(circle_list));
  102. choiceId_trials = clusterResult.('choice-Final'); % nan(length(stim), 1);
  103. choiceId_trials_exp{iSub, iExp} = choiceId_trials;
  104. %% ------ Clicked-based measures ------
  105. %%% total accuracy
  106. clickAcc_exp(iSub, 1, iExp) = length(find(respSig_Col == 0 | respSig_Col == 1)) / length(respSig_Col); %% accuracy across all trials
  107. clickAcc_exp(iSub, 2, iExp) = length(find(respSig_Col == 0)) / length(find(respSig_Col == 0 | respSig_Col == 2)); %% accuracy in response before cue trials
  108. clickAcc_exp(iSub, 3, iExp) = length(find(respSig_Col == 1)) / length(find(respSig_Col == 1 | respSig_Col == 3)); %% accuracy in response after cue trials
  109. %% ------ Mouse-trajectory based choice ------
  110. %% merge all trials
  111. for iTp = 1 : length(circle_list)
  112. choiceId_i = choiceId(:, iTp);
  113. choiceId_i(isnan(choiceId_i)) = [];
  114. angAcc(iSub, iTp) = length(find(choiceId_i == 1)) / length(choiceId_i);
  115. lenData(iSub, iTp) = length(choiceId_i);
  116. end
  117. %% accuracy in different node degrees when subjects made a response or at t=0.8s
  118. dgr_i = 4;
  119. nodeFind = find(nodeDegree == dgr_i);
  120. %%% degree of from nodes = 4
  121. trlIdx = arrayfun(@(x) ismember(x, nodeFind), from_nodes); %% including correct and incorrect responses
  122. choiceId_from = choiceId_trials(trlIdx);
  123. choiceId_from(isnan(choiceId_from)) = [];
  124. angAcc_dgr_oneHot(iSub, 1) = length(find(choiceId_from == 1)) / length(choiceId_from);
  125. dgr_oneHot_N_exp(iSub, 1, iExp) = length(find(trlIdx == 1));
  126. dgr_oneHot_trlIdx_exp{iSub, 1, iExp} = find(trlIdx == 1);
  127. %%% degree of to nodes = 4
  128. trlIdx = arrayfun(@(x) ismember(x, nodeFind), to_nodes);
  129. choiceId_to = choiceId_trials(trlIdx);
  130. choiceId_to(isnan(choiceId_to)) = [];
  131. angAcc_dgr_oneHot(iSub, 2) = length(find(choiceId_to == 1)) / length(choiceId_to);
  132. dgr_oneHot_N_exp(iSub, 2, iExp) = length(find(trlIdx == 1));
  133. dgr_oneHot_trlIdx_exp{iSub, 2, iExp} = find(trlIdx == 1);
  134. %%% both the degree of fromNode & toNode equal 4
  135. trlIdx_from = arrayfun(@(x) ismember(x, nodeFind), from_nodes);
  136. trlIdx_to = arrayfun(@(x) ismember(x, nodeFind), to_nodes);
  137. trlIdx = find(trlIdx_from == 1 & trlIdx_to == 1);
  138. choiceId_both = choiceId_trials(trlIdx);
  139. choiceId_both(isnan(choiceId_both)) = [];
  140. angAcc_dgr_oneHot(iSub, 3) = length(find(choiceId_both == 1)) / length(choiceId_both);
  141. dgr_oneHot_N_exp(iSub, 3, iExp) = length(trlIdx);
  142. dgr_oneHot_trlIdx_exp{iSub, 3, iExp} = trlIdx;
  143. %% learning effect: accuracy in sliding bins at decision time
  144. for iB = 1 : BinL
  145. trlIdx = (iB - 1) * nBin + 1 : iB * nBin;
  146. choiceId_trl = choiceId_trials(trlIdx);
  147. choiceId_trl(isnan(choiceId_trl)) = [];
  148. angAcc_oneHot_ln(iSub, iB) = length(find(choiceId_trl == 1)) / length(choiceId_trl);
  149. end
  150. %% merge all trials: before-cue-response or at 0.8 s
  151. choiceId_trials(isnan(choiceId_trials)) = [];
  152. angAcc_oneHot(iSub) = length(find(choiceId_trials == 1)) / length(choiceId_trials);
  153. end
  154. angAcc_exp(:, :, iExp) = angAcc; %% angAcc = zeros(subLen, length(circle_list));
  155. angAcc_oneHot_exp(:, iExp) = angAcc_oneHot; %% angAcc_oneHot = zeros(subLen, 1);
  156. angAcc_dgr_oneHot_exp(:, :, iExp) = angAcc_dgr_oneHot; %% angAcc_dgr_oneHot = zeros(subLen, 3);
  157. angAcc_oneHot_ln_exp(:, :, iExp) = angAcc_oneHot_ln; %% angAcc_oneHot_ln = nan(subLen, BinL);
  158. end
  159. %% color settings
  160. colorSets = [249, 183, 176; ...
  161. 138, 170, 51; ...
  162. 84, 185, 211; ...
  163. 248, 218, 172; ...
  164. 184, 204, 225; ...
  165. 210, 234, 200; ...
  166. 198, 127, 192; ...
  167. 219, 204, 226] ./ [255, 255, 255];
  168. %% ------ Figure 2d: Time-resolved prediction accuracy of four networks ------
  169. % & %% ------ Figure S3A: Decision preference within a trial ------
  170. datFlg = 1;
  171. if datFlg == 1 % all 40 subjects
  172. angAcc_tc = angAcc_exp;
  173. elseif datFlg == 2 % 20 in-lab subjects
  174. angAcc_tc = angAcc_exp(1 : 20, :, :);
  175. elseif datFlg == 3 % 20 online subjects
  176. angAcc_tc = angAcc_exp(21 : end, :, :);
  177. end
  178. stat_mat = zeros(length(circle_list), 2, nExp); % 4 networks
  179. for iExp = 1 : nExp
  180. for iTime = 1 : length(circle_list)
  181. angAcc_exp_i = angAcc_tc(:, iTime, iExp);
  182. [h, p, ci, stats] = ttest(angAcc_exp_i, 1/2, 'Tail', 'both');
  183. stat_mat(iTime, 1, iExp) = p;
  184. stat_mat(iTime, 2, iExp) = stats.tstat;
  185. end
  186. end
  187. LineSty = '-';
  188. for iExp = 1 : nExp
  189. figure('Position', [100 100 240 160]), clf;
  190. angAcc_exp_i = angAcc_tc(:, :, iExp);
  191. for iSub = 1 : size(angAcc_exp_i, 1)
  192. plot(circle_list, angAcc_exp_i(iSub, :), 'Color', [0.6, 0.6, 0.6], 'LineStyle', '-', 'LineWidth', 0.5); hold on;
  193. end
  194. [acc_avg, acc_sem] = Mean_and_Se(angAcc_exp_i, 1);
  195. shadedErrorBar(circle_list, acc_avg, acc_sem, {'Color', colorSets(iExp, :), 'MarkerFaceColor', colorSets(iExp, :), 'LineStyle', LineSty, 'LineWidth', 3}, 0.5); hold on;
  196. ylim([0.4, 1]);
  197. ylimit = ylim;
  198. xLoc = 0.99;
  199. % mark the significance
  200. [~, ~, ~, adj_p] = fdr_bh(squeeze(stat_mat(:, 1, iExp)), 0.05, 'pdep');
  201. for iCir = 1 : length(circle_list)
  202. pval_j = adj_p(iCir);
  203. if pval_j < 0.05
  204. plot(circle_list(iCir), xLoc * ylimit(end), 'Marker', '.', 'MarkerSize', 4, 'Color', colorSets(iExp, :), 'MarkerFaceColor', colorSets(iExp, :), 'LineStyle', 'none'); hold on;
  205. end
  206. end
  207. plot(xlim, [1/2, 1/2], 'k--', 'LineWidth', 1); hold on;
  208. plot([0.8, 0.8], ylim, 'k--', 'LineWidth', 1); hold on;
  209. ylim([0.4, 1]);
  210. set(gca, 'LineWidth', 2);
  211. set(gca, 'FontSize', 14, 'FontWeight', 'bold', 'FontName', 'Arial');
  212. set(gca, 'XTick', 0 : 0.4 : 1.5, 'XTickLabel', [0, 0.4, 0.8, 1.2]);
  213. set(gca, 'YTick', 0.4 : 0.1 : 1, 'YTickLabel', {'', '0.5', '', '', '', '', '1'});
  214. box off;
  215. end
  216. %% ------ Figure 2e: Overall prediction accuracy of four networks ------
  217. % & %% ------ Figure S3B: Overall accuracy comparison of the four networks (in-lab and online separately) ------
  218. datFlg = 1;
  219. if datFlg == 1 % all 40 subjects
  220. angAcc_oneHot_tc = angAcc_oneHot_exp;
  221. elseif datFlg == 2 % 20 in-lab subjects
  222. angAcc_oneHot_tc = angAcc_oneHot_exp(1 : 20, :);
  223. elseif datFlg == 3 % 20 online subjects
  224. angAcc_oneHot_tc = angAcc_oneHot_exp(21 : end, :);
  225. end
  226. stat_mat = zeros(nExp, 2); % 4 networks
  227. for iExp = 1 : nExp
  228. [h, p, ci, stats] = ttest(angAcc_oneHot_tc(:, iExp), 1/2, 'Tail', 'both');
  229. stat_mat(iExp, 1) = p;
  230. stat_mat(iExp, 2) = stats.tstat;
  231. end
  232. [~, ~, ~, adj_p] = fdr_bh(stat_mat(:, 1), 0.05, 'pdep');
  233. figure('Position', [100 100 420 220]), clf;
  234. vs = violinplot(angAcc_oneHot_tc, [1,2,3,4], 'Width', 0.3, 'ViolinColor', colorSets, 'ViolinAlpha', 0.1, 'MarkerSize', 30,...
  235. 'MedianMarkerSize', 100, 'EdgeColor', [0,0,0], 'BoxColor', [0,0,0]);
  236. xlim([0.5, 4.5]);
  237. ylim([0.45, 0.7]);
  238. set(gca, 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  239. set(gca, 'XTick', '', 'XTickLabel', '');
  240. set(gca, 'YTick', 0.5 : 0.1 : 0.7, 'YTickLabel', 0.5 : 0.1 : 0.7);
  241. plot(xlim, [0.5, 0.5], 'k--', 'LineWidth', 1); hold on;
  242. box off;
  243. %% ------ Figure S4: Learning curves for the 4 transition networks in Experiment 1 ------
  244. datFlg = 1;
  245. if datFlg == 1 % all 40 subjects
  246. angAcc_oneHot_ln_tc = angAcc_oneHot_ln_exp;
  247. elseif datFlg == 2 % 20 in-lab subjects
  248. angAcc_oneHot_ln_tc = angAcc_oneHot_ln_exp(1 : 20, :, :);
  249. elseif datFlg == 3 % 20 online subjects
  250. angAcc_oneHot_ln_tc = angAcc_oneHot_ln_exp(21 : end, :, :);
  251. end
  252. [data_avg, data_sem] = Mean_and_Se(angAcc_oneHot_ln_tc, 1);
  253. data_avg = squeeze(data_avg); % BinL * nExp
  254. data_sem = squeeze(data_sem);
  255. figure('Position', [100 100 300 200]), clf;
  256. for iExp = 1 : length(network_list)
  257. errorbar(1 : 1 : BinL, data_avg(:, iExp), data_sem(:, iExp), 'Color', colorSets(iExp, :), 'LineStyle', '-', 'LineWidth', 3); hold on;
  258. plot(1 : 1 : BinL, data_avg(:, iExp), 'Marker', '.', 'MarkerSize', 15, 'Color', colorSets(iExp, :), 'LineStyle', 'none'); hold on;
  259. end
  260. xlim([1-0.5, BinL+0.5]);
  261. ylim([0.4, 0.7]);
  262. plot(xlim, [1/2, 1/2], 'k--', 'LineWidth', 1); hold on;
  263. set(gca, 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  264. set(gca, 'XTick', 1 : 1 : BinL, 'XTickLabel', 1 : 1 : BinL);
  265. set(gca, 'YTick', 0.4 : 0.1 : 0.7, 'YTickLabel', 0.4 : 0.1 : 0.7);
  266. box off;
  267. %% ------ Figure S5A: The numbers of trials under each node-degree matched condition ------
  268. figure('Position', [100 100 120 220]), clf;
  269. for iExp = 1 : nExp
  270. dgr_matched_N = dgr_oneHot_N_exp(:, :, iExp); % 3 columns: (1) from-node matched; (2) to-node matched; (3) both from- and to-node matched
  271. [Nmean, Nsem] = Mean_and_Se(dgr_matched_N, 1);
  272. plot(1 : 1 : 3, Nmean, 'Marker', '.', 'MarkerSize', 35, 'Color', colorSets(iExp, :), 'lineStyle', '-', 'LineWidth', 3); hold on;
  273. for i = 1 : 3
  274. errorbar(i, Nmean(i), Nsem(i), 'Color', colorSets(iExp, :), 'LineStyle', '-', 'LineWidth', 3); hold on;
  275. end
  276. end
  277. xlim([1-0.5, 3+0.5]);
  278. ylim([0, 1000]);
  279. set(gca, 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  280. set(gca, 'XTick', 1 : 1 : 3, 'XTickLabel', {'Cue', 'Target', 'Cue & target'});
  281. set(gca, 'YTick', 0 : 500 : 1000, 'YTickLabel', 0 : 500 : 1000);
  282. box off;
  283. %% ------ Figure 5B: Overall prediction accuracy of four networks with three types of node-degree matched conditions ------
  284. plotFlg = 1; % 1: degree of fromNode = 4; 2: degree of toNode = 4; 3: both from & to = 4;
  285. dataPlot = squeeze(angAcc_dgr_oneHot_exp(:, plotFlg, :));
  286. figure('Position', [100 100 420 220]), clf;
  287. vs = violinplot(dataPlot, [1,2,3,4], 'Width', 0.3, 'ViolinColor', colorSets, 'ViolinAlpha', 0.1, 'MarkerSize', 30,...
  288. 'MedianMarkerSize', 100, 'EdgeColor', [0,0,0], 'BoxColor', [0,0,0]);
  289. xlim([0.5, 4.5]);
  290. set(gca, 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  291. set(gca, 'XTick', '', 'XTickLabel', '');
  292. if plotFlg == 1 || plotFlg == 2
  293. ylim([0.4, 0.7]);
  294. set(gca, 'YTick', 0.4 : 0.1 : 0.7, 'YTickLabel', 0.4 : 0.1 : 0.7);
  295. elseif plotFlg == 3
  296. ylim([0.3, 0.8]);
  297. set(gca, 'YTick', 0.3 : 0.1 : 0.8, 'YTickLabel', 0.3 : 0.1 : 0.8);
  298. end
  299. plot(xlim, [0.5, 0.5], 'k--', 'LineWidth', 1); hold on;
  300. box off;
  301. %% ------ Figure S6A: Proportion of above-chance subjects ------
  302. % ------ convert the accuracy per time point across participants into
  303. % proportation of above-chance participants ------
  304. propSubj_aboveChance_time = zeros(nExp, length(circle_list));
  305. for iExp = 1 : nExp
  306. angAcc_exp_i = angAcc_exp(:, :, iExp);
  307. propSubj_count = (~isnan(angAcc_exp_i) & angAcc_exp_i > 0.5);
  308. propSubj_aboveChance_time(iExp, :) = sum(propSubj_count, 1) / size(propSubj_count, 1);
  309. end
  310. LineSty = '-';
  311. figure('Position', [100 100 240 160]), clf;
  312. for iExp = 1 : nExp
  313. plot(circle_list(2 : end), propSubj_aboveChance_time(iExp, 2 : end), 'Color', colorSets(iExp, :), 'LineStyle', '-', 'LineWidth', 2); hold on;
  314. ylim([0, 1]);
  315. ylimit = ylim;
  316. plot(xlim, [1/2, 1/2], 'k--', 'LineWidth', 1); hold on;
  317. plot([0.8, 0.8], ylim, 'k--', 'LineWidth', 1); hold on;
  318. ylim([0, 1]);
  319. set(gca, 'LineWidth', 2);
  320. set(gca, 'FontSize', 14, 'FontWeight', 'bold', 'FontName', 'Arial');
  321. set(gca, 'XTick', 0 : 0.4 : 1.5, 'XTickLabel', [0, 0.4, 0.8, 1.2]);
  322. set(gca, 'YTick', 0 : 0.5 : 1, 'YTickLabel', [0, 0.5, 1]);
  323. box off;
  324. end
  325. %% ------ Figure S6B: Time-resolved prediction accuracy for high- and low-performance subjects of four networks ------
  326. % For each group, splitting participants into high and low performance and
  327. % redraw the accuracy time curve
  328. HighLow_idx_exp = nan(20, 2, nExp); % 2: high vs. low performance participants
  329. angAcc_HighLow_time = nan(20, length(circle_list), 2, nExp);
  330. angAcc_oneHot_HighLow = nan(20, 2, nExp);
  331. stat_mat_HighLow = nan(length(circle_list), 2, 2, nExp);
  332. for iExp = 1 : nExp
  333. % ------ Sort based on one-hot metric ------
  334. angAcc_iExp = angAcc_oneHot_exp(:, iExp);
  335. [~, angAcc_idx] = sort(angAcc_iExp, 'descend'); % default: 'ascend'
  336. split_half = ceil(length(angAcc_idx) / 2);
  337. high_idx = angAcc_idx(1 : split_half);
  338. low_idx = angAcc_idx((split_half + 1) : end);
  339. % ------ assign the participants index for High- and Low-performance group ------
  340. HighLow_idx_exp(:, 1, iExp) = high_idx;
  341. HighLow_idx_exp(:, 2, iExp) = low_idx;
  342. % ------ Reassign participants into high- vs. low-performance group ------
  343. angAcc_HighLow_time(:, :, 1, iExp) = angAcc_exp(high_idx, :, iExp);
  344. angAcc_HighLow_time(:, :, 2, iExp) = angAcc_exp(low_idx, :, iExp);
  345. angAcc_oneHot_HighLow(:, 1, iExp) = angAcc_oneHot_exp(high_idx, iExp);
  346. angAcc_oneHot_HighLow(:, 2, iExp) = angAcc_oneHot_exp(low_idx, iExp);
  347. % Statistical test
  348. for ii = 1 : 2 % High and Low-performance participants
  349. for iTime = 1 : length(circle_list)
  350. angAcc_exp_i = angAcc_HighLow_time(:, iTime, ii, iExp);
  351. [h, p, ci, stats] = ttest(angAcc_exp_i, 1/2, 'Tail', 'both');
  352. stat_mat_HighLow(iTime, 1, ii, iExp) = p;
  353. stat_mat_HighLow(iTime, 2, ii, iExp) = stats.tstat;
  354. end
  355. end
  356. end
  357. %%
  358. LineSty_list = {'-', ':'};
  359. for iExp = 1 : nExp
  360. figure('Position', [100 100 240 160]), clf;
  361. angAcc_exp_i = angAcc_exp(:, :, iExp);
  362. for iSub = 1 : size(angAcc_exp_i, 1)
  363. plot(circle_list, angAcc_exp_i(iSub, :), 'Color', [0.6, 0.6, 0.6], 'LineStyle', '-', 'LineWidth', 0.5); hold on;
  364. end
  365. for ii = 1 : 2 % high- vs. low-performance participants
  366. [acc_avg, acc_sem] = Mean_and_Se(angAcc_HighLow_time(:, :, ii, iExp), 1);
  367. shadedErrorBar(circle_list(2 : end), acc_avg(2 : end), acc_sem(2 : end), {'Color', colorSets(iExp, :), 'MarkerFaceColor', colorSets(iExp, :), 'LineStyle', LineSty_list{ii}, 'LineWidth', 3}, 0.5); hold on;
  368. end
  369. ylim([0.4, 1]);
  370. ylimit = ylim;
  371. xLoc = 0.99;
  372. for ii = 1 : 2 % High and Low-performance participants
  373. % mark the significance
  374. [~, ~, ~, adj_p] = fdr_bh(squeeze(stat_mat_HighLow(:, 1, ii, iExp)), 0.05, 'pdep'); % method: 'dep', 'pdep'
  375. for iCir = 1 : length(circle_list)
  376. pval_j = adj_p(iCir);
  377. if pval_j < 0.05
  378. plot(circle_list(iCir), xLoc * ylimit(end), 'Marker', '.', 'MarkerSize', 4, 'Color', colorSets(iExp, :), 'MarkerFaceColor', colorSets(iExp, :), 'LineStyle', 'none'); hold on;
  379. end
  380. end
  381. xLoc = xLoc - 0.03;
  382. end
  383. plot(xlim, [1/2, 1/2], 'k--', 'LineWidth', 1); hold on;
  384. plot([0.8, 0.8], ylim, 'k--', 'LineWidth', 1); hold on;
  385. ylim([0.4, 1]); % left axis limits
  386. set(gca, 'LineWidth', 2);
  387. set(gca, 'FontSize', 14, 'FontWeight', 'bold', 'FontName', 'Arial');
  388. set(gca, 'XTick', 0 : 0.4 : 1.5, 'XTickLabel', [0, 0.4, 0.8, 1.2]);
  389. set(gca, 'YTick', 0.4 : 0.1 : 1, 'YTickLabel', {'', '0.5', '', '', '', '', '1'});
  390. box off;
  391. ax = gca;
  392. end
  393. %% ------ Figure S6C: Overall accuracy for high- and low-performance subjects across four networks ------
  394. for ii = 1 : 2 % High and Low-performance participants
  395. figure('Position', [100 100 420 220]), clf;
  396. vs = violinplot(squeeze(angAcc_oneHot_HighLow(:, ii, :)), [1,2,3,4], 'Width', 0.3, 'ViolinColor', colorSets, 'ViolinAlpha', 0.1, 'MarkerSize', 30,...
  397. 'MedianMarkerSize', 100, 'EdgeColor', [0,0,0], 'BoxColor', [0,0,0]);
  398. xlim([0.5, 4.5]);
  399. ylim([0.4, 0.7]);
  400. set(gca, 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  401. set(gca, 'XTick', '', 'XTickLabel', '');
  402. set(gca, 'YTick', 0.4 : 0.1 : 0.7, 'YTickLabel', 0.4 : 0.1 : 0.7);
  403. plot(xlim, [0.5, 0.5], 'k--', 'LineWidth', 1); hold on;
  404. box off;
  405. end
  406. %% ------ Figure S8A: Click-accuracy from before-hint-response trials in Experiment 1 ------
  407. % clickAcc_exp = zeros(subLen, 3, nExp); % 3: 1) overall accuracy; 2) before-hint accuracy; 3) after-hint accuracy
  408. metric_plot_category = squeeze(clickAcc_exp(:, 2, :)); % before-hint click accuracy
  409. figure('Position', [100 100 420 220]), clf;
  410. vs = violinplot(metric_plot_category, [1,2,3,4], 'Width', 0.3, 'ViolinColor', colorSets, 'ViolinAlpha', 0.1, 'MarkerSize', 30,...
  411. 'MedianMarkerSize', 100, 'EdgeColor', [0,0,0], 'BoxColor', [0,0,0]);
  412. xlim([0.5, 4.5]);
  413. ylim([0, 1]);
  414. set(gca, 'FontName', 'Arial', 'FontSize', 14, 'FontWeight', 'Bold', 'LineWidth', 2);
  415. set(gca, 'XTick', '', 'XTickLabel', '');
  416. set(gca, 'YTick', 0 : 0.2 : 1, 'YTickLabel', 0 : 0.2 : 1);
  417. plot(xlim, [0.5, 0.5], 'k--', 'LineWidth', 1); hold on;
  418. box off;
  419. ax = gca;

Fig2andSI.m, no license · at the source

Overview

Authors: Xiangjuan Ren1,2,3,4,5, Muzhi Wang1,2,3,6, Tingting Qin7, Fang Fang1,2,3,8, Aming Li7,9,10, Huan Luo1,2,3
  1. School of Psychological and Cognitive Sciences, Peking University, Beijing, China
  2. PKU-IDG/McGovern Institute for Brain Research, Peking University, Beijing, China
  3. Key Laboratory of Machine Perception (Ministry of Education), Peking University, Beijing, China
  4. Latent Learning Lab, Institute of Psychology, Universität Hamburg, Hamburg, Germany
  5. Max Planck Institute for Human Development, Berlin, Germany
  6. Applied Computational Psychiatry Lab, Max Planck UCL Centre for Computational Psychiatry and Ageing Research, Queen Square Institute of Neurology, UCL, London, UK
  7. Center for Systems and Control, School of Advanced Manufacturing and Robotics, Peking University, Beijing, China
  8. Peking-Tsinghua Center for Life Sciences, Peking University, Beijing, China
  9. Research Center for Robotics, Peking University, Beijing, China
  10. Center for Multi-Agent Research, Institute for Articial Intelligence, Peking University, Beijing, China
Journal: Nature communications, volume 17, issue 1, article 8771
Dates: received 12 September 2025; accepted 14 July 2026; published online 17 July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41467-026-75843-7 · PMID 42469233 · PMCID PMC13494043 · OpenAlex W7169508696
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: MEG (modality), human (organism), cognitive (subfield)
Methods: Connectivity, Spectral & time-frequency, Statistics, Smoothing, state filtering, decompositions, Graphs, Machine learning
Keywords: Human behaviour, Cognitive neuroscience
MeSH: Knowledge*, Learning*, Neural Networks, Computer*, Computer Simulation, Gyrus Cinguli, Humans, Magnetoencephalography, Nerve Net (* major topic)
Topic: Neural Networks and Reservoir Computing (Artificial Intelligence, Computer Science), according to OpenAlex
Funding: National Natural Science Foundation of China (National Science Foundation of China) (32541013, T2525017, 62533002, 62173004, T2421004); European Research Council (852669)
Citations: cited by 1 paper (Europe PMC); 108 references in the paper

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 11 matches between paragraphs and lines of code.

OSF dm3z9

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: MATLAB (34)
Size: 45 files, 34 scripts
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
34 files
At the source:

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: OSF dm3z9

Read it in the paper: doi.org/10.1038/s41467-026-75843-7.

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;
  • 34 scripts, each with its path and the digest of its content;
  • 11 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.

Data availability statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • no repository, dataset or request procedure was recognized in it

Read it in the paper: doi.org/10.1038/s41467-026-75843-7.

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 2 keywords, 8 MeSH terms, 2 funders, 89 references.

Cite

This paper

Ren, X., Wang, M., Qin, T., Fang, F., Li, A., & Luo, H. (2026). Compressive learning scaffolds higher-order network structure to enhance human knowledge acquisition. Nature communications, 17(1), 8771. https://doi.org/10.1038/s41467-026-75843-7

BibTeX

@article{ren2026compressive,
author = {Ren, Xiangjuan and Wang, Muzhi and Qin, Tingting and Fang, Fang and Li, Aming and Luo, Huan},
title = {{Compressive learning scaffolds higher-order network structure to enhance human knowledge acquisition}},
journal = {Nature communications},
year = {2026},
month = jul,
volume = {17},
number = {1},
pages = {8771},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-75843-7},
url = {https://doi.org/10.1038/s41467-026-75843-7},
pmid = {42469233},
pmcid = {PMC13494043}
}

RIS

TY - JOUR
AU - Ren, Xiangjuan
AU - Wang, Muzhi
AU - Qin, Tingting
AU - Fang, Fang
AU - Li, Aming
AU - Luo, Huan
TI - Compressive learning scaffolds higher-order network structure to enhance human knowledge acquisition
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/07/17
VL - 17
IS - 1
SP - 8771
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-75843-7
UR - https://doi.org/10.1038/s41467-026-75843-7
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-75843-7",
"type": "article-journal",
"title": "Compressive learning scaffolds higher-order network structure to enhance human knowledge acquisition",
"container-title": "Nature communications",
"author": [
{
"family": "Ren",
"given": "Xiangjuan"
},
{
"family": "Wang",
"given": "Muzhi"
},
{
"family": "Qin",
"given": "Tingting"
},
{
"family": "Fang",
"given": "Fang"
},
{
"family": "Li",
"given": "Aming"
},
{
"family": "Luo",
"given": "Huan"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "8771",
"DOI": "10.1038/s41467-026-75843-7",
"PMID": "42469233",
"PMCID": "PMC13494043",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-75843-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
17
]
]
}
}

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.1371/journal.pbio.3003756
Human brains construct individualized global rankings from identical few-shot learning input.
Journal: PLoS biology
In common: MEG, cognitive, 3 references, 2 authors
[2] doi:10.1016/j.cub.2026.05.068 [code]
An abstract relational map emerges in the human medial prefrontal cortex with consolidation.
Journal: Current biology : CB
In common: Statistics and Machine Learning Toolbox, 9 references
[3] doi:10.1038/s41597-026-07350-9 [code]
An open multi-center MEG-EEG dataset for studying conscious visual perception.
Journal: Scientific data
In common: Statistics and Machine Learning Toolbox, MEG, 1 reference, author Huan Luo
[4] doi:10.1038/s41467-026-71428-6 [code]
Binding items to contexts through conjunctive neural representations with the method of loci.
Journal: Nature communications
In common: 6 references
[5] doi:10.7554/elife.108023 [code]
Challenges in replay detection by TDLM in post-encoding resting state.
Journal: eLife
In common: shadedErrorBar, Statistics and Machine Learning Toolbox, MEG, 3 references
[6] doi:10.1038/s41467-026-71604-8 [code]
Respiration as a dynamic modulator of sensory sampling.
Journal: Nature communications
In common: Violinplot-Matlab, fdr_bh (Benjamini-Hochberg FDR), Statistics and Machine Learning Toolbox, MEG, cognitive, 1 reference
[7] doi:10.1038/s41467-026-72510-9 [code]
Single-neuron network topology governs neural computation and learning in primate cortex.
Journal: Nature communications
In common: Statistics and Machine Learning Toolbox, cognitive, 1 reference, author Fang Fang
[8] doi:10.1371/journal.pbio.3003938 [code]
Theta oscillations tag episodic memories for sleep-dependent consolidation.
Journal: PLoS biology
In common: fdr_bh (Benjamini-Hochberg FDR), shadedErrorBar, Statistics and Machine Learning Toolbox, cognitive, 1 reference
[9] doi:10.7554/elife.103689 [code]
Dissociable dynamic effects of expectation during statistical learning.
Journal: eLife
In common: Violinplot-Matlab, shadedErrorBar, Statistics and Machine Learning Toolbox, 1 reference
[10] doi:10.1002/aur.70312 [code]
Aberrant Neural Entrainment to Word-Level Speech Patterns in Fragile X Syndrome: Evidence for a Statistical Learning Deficit.
Journal: Autism research : official journal of the International Society for Autism Research
In common: shadedErrorBar, Statistics and Machine Learning Toolbox, cognitive, 2 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.

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.