Sampled geodesic flow
neureptrace.decoding.geodesic_flow implements dependency-light sampled geodesic-flow features for cross-subject transfer.
The protocol is Category 2 / unlabeled target-adaptive. It fits a PCA basis on source features and a second PCA basis on unlabeled target features, samples orthonormal intermediate bases between them, and represents rows by concatenating projections onto the sampled bases.
No target labels are accepted by the public API.
Typical usage:
from neureptrace.decoding.geodesic_flow import fit_sampled_geodesic_flow_features
result = fit_sampled_geodesic_flow_features(
source_features=X_source,
target_adaptation_features=X_target_calib, # optional; otherwise target_test is transductive
target_test_features=X_target_test,
config={"n_components": 16, "n_steps": 5},
)
X_source_gf = result.train_features
X_target_gf = result.test_features
neureptrace.decoding.geodesic_flow
Sampled geodesic-flow features for Category-2 transfer.
GeodesicFlowConfig
dataclass
Configuration for sampled geodesic-flow features.
Source code in src/neureptrace/decoding/geodesic_flow.py
21 22 23 24 25 26 27 28 29 30 31 | |
GeodesicFlowBasis
dataclass
One sampled orthonormal basis along the source-target path.
Source code in src/neureptrace/decoding/geodesic_flow.py
34 35 36 37 38 39 | |
GeodesicFlowResult
dataclass
Geodesic-flow train/test features and protocol metadata.
Source code in src/neureptrace/decoding/geodesic_flow.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
fit_sampled_geodesic_flow_features(*, source_features, target_test_features, config=None, target_adaptation_features=None)
Fit sampled geodesic-flow features from source and unlabeled target data.
Source code in src/neureptrace/decoding/geodesic_flow.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
geodesic_flow_config(*, n_components=DEFAULT_GEODESIC_COMPONENTS, n_steps=DEFAULT_GEODESIC_STEPS, center=True, scale=False, include_endpoints=True, normalize_blocks=True, epsilon=1e-08)
Normalize public sampled-geodesic options.
Source code in src/neureptrace/decoding/geodesic_flow.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
sample_geodesic_bases(source_components, target_components, *, n_steps=DEFAULT_GEODESIC_STEPS, include_endpoints=True)
Sample orthonormal bases between source and target PCA bases.
Source code in src/neureptrace/decoding/geodesic_flow.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
transform_with_geodesic_bases(features, bases, *, normalize_blocks=True)
Concatenate projections onto sampled geodesic bases.
Source code in src/neureptrace/decoding/geodesic_flow.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |