bentang18 commited on
Commit
4e533b4
·
verified ·
1 Parent(s): 7b406ec

Release MAPA checkpoints, model card, and preprocessing configuration

Browse files
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
LICENSE-WEIGHTS ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MAPA
2
+ Copyright 2026 Ben Tang, Zachary Spalding, and Gregory B. Cogan
3
+
4
+ ================================================================================
5
+ What each license covers
6
+ ================================================================================
7
+
8
+ Source code and released model checkpoints are licensed under the Apache License,
9
+ Version 2.0. See LICENSE. LICENSE-WEIGHTS contains the same Apache 2.0 license
10
+ for standalone checkpoint downloads. The checkpoint license covers:
11
+
12
+ mapa_vits384.pt
13
+ mapa_vits384_no_region.pt
14
+ mapa_vits384_no_relpos.pt
15
+ mapa_vits384_no_priors.pt
16
+
17
+ ================================================================================
18
+ Prior checkpoint licensing
19
+ ================================================================================
20
+
21
+ Before September 14, 2026, these checkpoints were distributed under CC BY 4.0.
22
+ That earlier license grant remains valid; this Apache 2.0 release does not revoke
23
+ it. The checkpoint files are unchanged. The original license is preserved at:
24
+ https://github.com/bentang18/MAPA/blob/v0.1.0/LICENSE-WEIGHTS
25
+
26
+ ================================================================================
27
+ Attribution
28
+ ================================================================================
29
+
30
+ The checkpoints were pretrained on the Brain Treebank dataset, released under
31
+ CC BY 4.0 at https://braintreebank.dev/. The dataset retains its own license.
32
+ Attribution for the pretraining data:
33
+
34
+ Christopher Wang, Adam Yaari, Aaditya K Singh, Vighnesh Subramaniam,
35
+ Dana Rosenfarb, Jan DeWitt, Pranav Misra, Joseph R Madsen, Scellig Stone,
36
+ Gabriel Kreiman, Boris Katz, Ignacio Cases, and Andrei Barbu.
37
+ Brain Treebank: Large-scale intracranial recordings from naturalistic
38
+ language stimuli. Advances in Neural Information Processing Systems 37
39
+ (NeurIPS 2024), Datasets and Benchmarks Track.
40
+
41
+ The evaluation follows Neuroprobe, https://github.com/insight-neuro/neuroprobe,
42
+ released under the MIT License, Copyright (c) 2025 Andrii Zahorodnii,
43
+ collaborators and contributors.
44
+
45
+ ================================================================================
46
+ Vendored Neuroprobe material
47
+ ================================================================================
48
+
49
+ mapa/data/_neuroprobe_lite_tables.py includes tables copied from Neuroprobe
50
+ commit c7b955b0a31464f4a5eec3f3bd78ff29841d61ac. The upstream license follows:
51
+
52
+ MIT License
53
+
54
+ Copyright (c) 2025 Andrii Zahorodnii, collaborators and contributors
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ of this software and associated documentation files (the "Software"), to deal
58
+ in the Software without restriction, including without limitation the rights
59
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ copies of the Software, and to permit persons to whom the Software is
61
+ furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in all
64
+ copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
+ SOFTWARE.
README.md CHANGED
@@ -1,3 +1,209 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ library_name: pytorch
4
+ tags:
5
+ - intracranial-eeg
6
+ - ieeg
7
+ - seeg
8
+ - neuroscience
9
+ - masked-autoencoder
10
+ - representation-learning
11
+ - feature-extraction
12
+ - arxiv:2609.13507
13
  ---
14
+
15
+ # MAPA
16
+
17
+ **Pretraining for Sample-Efficient Neural Interfaces**
18
+
19
+ Ben Tang, Zachary Spalding, Gregory B. Cogan · Duke University
20
+
21
+ [Code](https://github.com/bentang18/MAPA) · [Project page](https://bentang18.github.io/mapa-page/) · [Benchmark](https://neuroprobe.dev/)
22
+
23
+ Paper: [Pretraining for Sample-Efficient Neural Interfaces](https://arxiv.org/abs/2609.13507).
24
+
25
+ ## Model
26
+
27
+ MAPA is a masked autoencoder for intracranial EEG. An anatomical region embedding and a relative
28
+ positional encoding enable the model to learn neural representations that transfer across
29
+ subjects. The encoder is a ViT-Small with width 384 and 12 blocks. The decoder is discarded after
30
+ pretraining.
31
+
32
+ ## Quickstart
33
+
34
+ Requires Python 3.10+ and PyTorch 2.6+. Install MAPA and the Hugging Face download client:
35
+
36
+ ```bash
37
+ python -m pip install "git+https://github.com/bentang18/MAPA.git@39f75ecc383c1851efa490ced8efa6e91a5e49c3" huggingface_hub
38
+ ```
39
+
40
+ Download the main checkpoint and extract features from synthetic, preprocessed inputs:
41
+
42
+ ```python
43
+ import torch
44
+ from huggingface_hub import hf_hub_download
45
+ from mapa import MapaEncoder, build_sidecar
46
+
47
+ checkpoint = hf_hub_download("bentang18/MAPA", "mapa_vits384.pt")
48
+ encoder = MapaEncoder.from_checkpoint(checkpoint, device="cpu")
49
+
50
+ # Synthetic normalized magnitude STFT bands, not raw voltage.
51
+ labels = ["LA1", "LB1", "LA2", "LB2"]
52
+ sidecar = build_sidecar(labels, region_id=[0, 1, 0, 1])
53
+ session = encoder.prepare(sidecar, n_time=32)
54
+ bands = [torch.randn(1, 4, bins, 32) for bins in (7, 6, 7)]
55
+ features = encoder(bands, session, taps=(12,))[12]
56
+ print(features.shape) # torch.Size([1, 4, 52, 384])
57
+
58
+ # Restore the input contact order.
59
+ features = features[:, session.contact_order.argsort()]
60
+ ```
61
+
62
+ The checkpoint returns neural features; it does not include a task-specific decoder or produce
63
+ text. For raw recordings, install the preprocessing extra with
64
+ `python -m pip install "mapa[preprocessing] @ git+https://github.com/bentang18/MAPA.git@39f75ecc383c1851efa490ced8efa6e91a5e49c3"`
65
+ and follow the [preprocessing guide](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/docs/PREPROCESSING.md).
66
+ Use `mapa_vits384.pt` for feature extraction; the other three files reproduce the spatial-encoding ablations.
67
+
68
+ ## Inputs and outputs
69
+
70
+ A patch contains the frequency bins of one band, at one contact, at one time step of that band's
71
+ rate. Provide three normalized magnitude STFT tensors in Slow, Mid, Fast order. Each tensor has
72
+ shape `(batch, contacts, bins, time)`.
73
+
74
+ | Band | Window | Rate | Frequencies | Bins |
75
+ |---|---|---|---|---|
76
+ | Slow | 500 ms | 4 Hz | 2–14 Hz | 7 |
77
+ | Mid | 125 ms | 16 Hz | 16–56 Hz | 6 |
78
+ | Fast | 62.5 ms | 32 Hz | 64–160 Hz | 7 |
79
+
80
+ The encoder API accepts the three normalized magnitude STFT tensors on a shared 32 Hz frame
81
+ clock. The frontend decimates each band to the rate listed above. Each contact contributes 52
82
+ tokens per second. Features remain per-contact, in the order given by `session.contact_order`.
83
+
84
+ The region embedding uses the DKT atlas vocabulary, with 74 regions and one reserved entry.
85
+ The relative positional encoding uses the difference between clinical contact numbers along an
86
+ array. RoPE also encodes time. Neither spatial encoding uses coordinates in a template brain.
87
+
88
+ Map regions to their indices in `V14_DKT_REGION_LABELS` in
89
+ [anatomy.py](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/mapa/data/anatomy.py). The vocabulary distinguishes hemispheres. ID 74 is reserved
90
+ for contacts outside that vocabulary. Contact labels and region IDs must follow the input
91
+ tensor's contact order.
92
+
93
+ | Requested tap | Output for a one-second window |
94
+ |---|---|
95
+ | `0` | `(batch, contacts, 1, 348)` frontend input features |
96
+ | `3`, `6`, `9`, or `12` | `(batch, contacts, 52, 384)` encoder features |
97
+
98
+ The returned dictionary is keyed by tap number. All outputs use `session.contact_order`, which
99
+ indexes the input contacts. Encoder taps are taken before the output LayerNorm, matching the
100
+ paper's frozen readout. Tap 0 concatenates the decimated band values; it is not a 384-dimensional
101
+ encoder representation.
102
+
103
+ Use `mapa.preprocessing.prepare_recording` to produce these inputs from a full raw recording.
104
+ It includes referencing, filtering, STFTs, and frozen session normalization. Supply cleaned
105
+ recordings and explicit contact selections. The release includes the frozen per-session
106
+ Guard 1 exclusions used for Neuroprobe; these affect evaluation and must be applied before
107
+ shaft referencing. The Guard 1/2 detectors are not included, and Guard 2 does not reject
108
+ evaluation windows. The model applies Guard 3 before projection: Slow/Mid/Fast normalized
109
+ inputs are clipped to ±15/±15/±20. Tap 0 uses the same clipped inputs.
110
+ See the [preprocessing guide](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/docs/PREPROCESSING.md) and [configuration](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/mapa/preprocessing/config.json).
111
+
112
+ ## Checkpoints
113
+
114
+ The four checkpoint files are available in this repository and are byte-identical to the
115
+ [v0.1.0 GitHub release](https://github.com/bentang18/MAPA/releases/tag/v0.1.0).
116
+ The checkpoints are taken at step 55,000. Each records whether the region embedding and
117
+ relative positional encoding are active. The decoder and optimizer are not included.
118
+
119
+ | File | Region embedding | Relative positional encoding | Parameters |
120
+ |---|---|---|---|
121
+ | `mapa_vits384.pt` | Yes | Yes | 21,335,424 |
122
+ | `mapa_vits384_no_region.pt` | No | Yes | 21,306,624 |
123
+ | `mapa_vits384_no_relpos.pt` | Yes | No | 21,335,424 |
124
+ | `mapa_vits384_no_priors.pt` | No | No | 21,306,624 |
125
+
126
+ The region embedding contains 75 × 384 = 28,800 parameters. The release also includes
127
+ `SHA256SUMS`, `LICENSE-WEIGHTS`, `NOTICE`, and `preprocessing.json` (the shared frontend recipe). Verify downloaded files with `sha256sum -c SHA256SUMS`
128
+ (or `shasum -a 256 -c SHA256SUMS` on macOS). The expected checksums are:
129
+
130
+ ```
131
+ 2d236089a2f1a3cc2827e3f150c4a2ba14c51bbfaf0ce0888f84b92a6eb25a7a mapa_vits384.pt
132
+ d1a7258ffbb164b73b1f64ec798e9fab61fa635fcca3b28cf2820dee29091393 mapa_vits384_no_region.pt
133
+ 94ccd61a467cbf6c1adc23c96fa1f9f3558f8072f7842d6e514298b5f02b08f3 mapa_vits384_no_relpos.pt
134
+ e363a38e4ef923fc8bfb2b716321db9670897580e0141c8bba96677ef30a586d mapa_vits384_no_priors.pt
135
+ ```
136
+
137
+
138
+ ## Training data
139
+
140
+ We pretrain on 27.9 hours of Brain Treebank recordings from 13 sessions of 7 subjects. We mask
141
+ 75% of patches uniformly at random over contacts, bands, and time, and reconstruct their frequency
142
+ bins. No task labels are used during pretraining. Anatomical region assignments and clinical
143
+ contact numbers supply the spatial encodings. Two evaluation subjects, subjects 7 and 10, are
144
+ held out from pretraining entirely.
145
+
146
+ ## Evaluation
147
+
148
+ The encoder is frozen for all evaluations. The readout is a linear probe. Neuroprobe scores 15
149
+ binary tasks by AUROC, and we report the mean over tasks and evaluation sessions. Trials are
150
+ one-second windows at the benchmark's word anchors, with nonverbal anchors for negative speech
151
+ and onset examples. Evaluation covers 12 sessions from 6 subjects, with
152
+ at most 3,500 trials per task.
153
+
154
+ Within-session uses two folds: each fits on one half of the task's ordered trials and divides
155
+ the other half equally into validation and test trials. Reported AUROC averages the two test folds.
156
+ Cross-session fits on one session of a subject; cross-subject fits on one anchor subject.
157
+ Both split each target session's trials into validation and test halves. Validation labels
158
+ select the ridge regularization strength; test labels are used only for scoring.
159
+
160
+ | Regime | Frontend baseline | MAPA | Evaluation sessions |
161
+ |---|---|---|---|
162
+ | Within-session | .6744 | .6953 | 12 |
163
+ | Cross-session | .6660 | .6909 | 12 |
164
+ | Cross-subject | .5872 | .6083 | 10 |
165
+
166
+ The frontend baseline and MAPA share their frontend and readout. The gain comes from the
167
+ pretrained encoder alone. The unit of statistical analysis in the paper is the subject.
168
+
169
+ In the cross-subject regime, MAPA reaches the frontend baseline's full-data accuracy with
170
+ approximately 164 anchor-subject training trials rather than 3,500. The estimated label saving
171
+ is 21.3×, with a 95% bootstrap interval of 8.4–64.0×. Target-session validation labels remain
172
+ fixed while anchor training labels are subsampled; they are not included in that count.
173
+
174
+ ## Intended use and limitations
175
+
176
+ Use the encoder to extract features for downstream decoding. See the [README](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/README.md) for
177
+ input preprocessing and the [evaluation guide](https://github.com/bentang18/MAPA/blob/39f75ecc383c1851efa490ced8efa6e91a5e49c3/evals/README.md) for the published readout.
178
+
179
+ Pretraining and evaluation use sEEG recordings during passive movie-watching. These results do
180
+ not establish performance on attempted speech, imagined speech, or motor decoding.
181
+
182
+ The source Brain Treebank inventory has at most 16 contacts per shaft (index span at most 15).
183
+ This is an observed data range, not a fixed architectural ceiling; longer shafts have not been
184
+ validated. The spatial RoPE coordinate is a contact number along an array. It does not encode the two spatial
185
+ axes of an ECoG grid. Performance on surface grids is not established by these experiments.
186
+
187
+ Each ablation uses one seed. Two subjects are held out from pretraining entirely, and the result
188
+ on those subjects is descriptive. Label savings vary across subjects. Subjects that never reach
189
+ the target accuracy are retained as failures in the label-saving analysis.
190
+
191
+ ## License and attribution
192
+
193
+ Code and checkpoints: [Apache 2.0](LICENSE).
194
+ The checkpoints carry the Brain Treebank attribution in [NOTICE](NOTICE), which also records prior checkpoint licensing.
195
+ Evaluation follows [Neuroprobe](https://github.com/insight-neuro/neuroprobe).
196
+
197
+ ## Citation
198
+
199
+ ```bibtex
200
+ @misc{tang2026pretraining,
201
+ title={Pretraining for Sample-Efficient Neural Interfaces},
202
+ author={Ben Tang and Zachary Spalding and Gregory B. Cogan},
203
+ year={2026},
204
+ eprint={2609.13507},
205
+ archivePrefix={arXiv},
206
+ primaryClass={cs.LG},
207
+ url={https://arxiv.org/abs/2609.13507},
208
+ }
209
+ ```
SHA256SUMS ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ 2d236089a2f1a3cc2827e3f150c4a2ba14c51bbfaf0ce0888f84b92a6eb25a7a mapa_vits384.pt
2
+ d1a7258ffbb164b73b1f64ec798e9fab61fa635fcca3b28cf2820dee29091393 mapa_vits384_no_region.pt
3
+ 94ccd61a467cbf6c1adc23c96fa1f9f3558f8072f7842d6e514298b5f02b08f3 mapa_vits384_no_relpos.pt
4
+ e363a38e4ef923fc8bfb2b716321db9670897580e0141c8bba96677ef30a586d mapa_vits384_no_priors.pt
mapa_vits384.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d236089a2f1a3cc2827e3f150c4a2ba14c51bbfaf0ce0888f84b92a6eb25a7a
3
+ size 85391805
mapa_vits384_no_priors.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e363a38e4ef923fc8bfb2b716321db9670897580e0141c8bba96677ef30a586d
3
+ size 85277996
mapa_vits384_no_region.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1a7258ffbb164b73b1f64ec798e9fab61fa635fcca3b28cf2820dee29091393
3
+ size 85277996
mapa_vits384_no_relpos.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94ccd61a467cbf6c1adc23c96fa1f9f3558f8072f7842d6e514298b5f02b08f3
3
+ size 85393529
preprocessing.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recipe": "mapa-v0.1.0",
3
+ "sample_rate_hz": 2048,
4
+ "frame_rate_hz": 32,
5
+ "resample": "scipy.signal.resample_poly; default Kaiser window; input/output float32",
6
+ "model_reference": "mean of surviving selected contacts per shaft, before model filters",
7
+ "model_notches_hz": [
8
+ 60,
9
+ 120,
10
+ 180,
11
+ 240,
12
+ 300
13
+ ],
14
+ "highpass_hz": 0.5,
15
+ "filter": "MNE default FIR; zero phase; reflect_limited padding",
16
+ "contact_exclusions": "supplied by caller",
17
+ "artifact_cleaning": "external contact detection and window rejection",
18
+ "model_input_clip_z": [
19
+ 15.0,
20
+ 15.0,
21
+ 20.0
22
+ ],
23
+ "bands": [
24
+ {
25
+ "name": "slow",
26
+ "n_fft": 1024,
27
+ "hop": 64,
28
+ "bins_inclusive": [
29
+ 1,
30
+ 7
31
+ ]
32
+ },
33
+ {
34
+ "name": "mid",
35
+ "n_fft": 256,
36
+ "hop": 64,
37
+ "bins_inclusive": [
38
+ 2,
39
+ 7
40
+ ]
41
+ },
42
+ {
43
+ "name": "fast",
44
+ "n_fft": 128,
45
+ "hop": 64,
46
+ "bins_inclusive": [
47
+ 4,
48
+ 10
49
+ ]
50
+ }
51
+ ],
52
+ "stft": {
53
+ "window": "periodic Hann",
54
+ "center": true,
55
+ "padding": "reflect",
56
+ "normalized": false,
57
+ "representation": "magnitude; no log"
58
+ },
59
+ "normalization": {
60
+ "fit": "entire session, separately per contact and frequency bin",
61
+ "median": "torch lower median",
62
+ "mad_scale": 1.4826,
63
+ "sigma_floor": 1e-06,
64
+ "constant_bins": "zero"
65
+ },
66
+ "window_start": "round(seconds * 32), ties to even",
67
+ "voltage_scaling": "none"
68
+ }