Targets¶
Pack, unpack, and install hypernetwork-generated weights for a target layer (fully-connected, convolutional, attention Q/K, and Sigma-Pi conv).
polyweave.targets ¶
Target specs: pack / unpack / install generated weights for a target layer.
AttentionQKTargetSpec ¶
Bases: TargetSpec
Query/key projections for n_layers attention blocks of width d_model.
Source code in polyweave/targets/attention.py
TargetSpec ¶
Conv2dTargetSpec ¶
Bases: TargetSpec
A 2-D convolution kernel + bias.
Matches the CIFAR conv1 target: Conv2d(in_ch, out_ch, kernel). The mapping
from class-conditional image statistics to useful conv1 filters is substantially
more nonlinear than the FC mapping, and the pi branch grows accordingly.
Source code in polyweave/targets/conv.py
FCTargetSpec ¶
Bases: TargetSpec
A linear head y = W x + b with W in R^{out x in}, b in R^{out}.
In the paper this is the few-shot classification head whose optimal solution is (to first order) the class-centroid NCC rule — the regime where the pi branch stays dormant.
Source code in polyweave/targets/fc.py
SigmaPiConvTargetSpec ¶
Bases: TargetSpec
The two conv weight matrices (additive + log-space) of a Sigma-Pi block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels
|
int
|
input == output channels of the target |
required |
kernel_size
|
int
|
conv kernel size for both branches (default 3). |
3
|