cellmap_flow.finetune.rank
The rank score lives in cellmap_flow.portable.rank, the Python both modes run; this module keeps the import path the finetune package had for it.
Attributes
Functions
|
One channel's agreement with the paint per channel: the targets |
|
The painted voxels of |
|
The score of |
|
|
|
Add one painted block to |
|
|
Module Contents
- cellmap_flow.finetune.rank.CUTOFFS
- cellmap_flow.finetune.rank.NARROW_WINDOW = 0.25
- cellmap_flow.finetune.rank.RANK_BLOCKS = 32
- cellmap_flow.finetune.rank.RANK_SMOOTHING = 0.1
- cellmap_flow.finetune.rank.WINDOW_MARGIN = 0.03
- cellmap_flow.finetune.rank.empty_tallies(channels: int) List[dict]
One channel’s agreement with the paint per channel: the targets counted, their logits binned against CUTOFFS (bin b: above b of them), and the loss summed, apart for object and background targets.
- cellmap_flow.finetune.rank.paint_edges(labels: numpy.ndarray) numpy.ndarray
The painted voxels of
labels(z, y, x; 0 unpainted, 1 background, 2 and up objects) that touch a painted voxel of the other class along z, y or x: the strokes’ edges, which a binary model’s score leaves out.
- cellmap_flow.finetune.rank.rank_score(tallies: List[dict], channels: Sequence[str], affinity: bool) dict | None
The score of
tallies: an affinity model’s over its channels together (channelandchannel_indexNone), a binary model’s best channel’s (by the score, then the lower loss),channelits name inchannels(“channel <i>” past them) andchannel_indexits index, as select_channel takes it; withchannel_matches, every channel’s{channel, channel_index, matches}, the best first, which says why that one (organelle close behind mito, say). None when nothing was counted.
- cellmap_flow.finetune.rank.spread(items: Sequence, count: int) list
countofitems, spread evenly over them in their order; all of them when there are no more.
- cellmap_flow.finetune.rank.tally(tallies: List[dict], target: numpy.ndarray, mask: numpy.ndarray, logits: numpy.ndarray, skip: numpy.ndarray | None = None) None
Add one painted block to
tallies:targetandmask(C, z, y, x) as the finetune’s target transform makes them,logitsthe model’s on the same voxels (NaN where it was not read), andskip(z, y, x) the voxels not to count (paint_edges), or None.
- cellmap_flow.finetune.rank.windowed(norm: Sequence[dict], lo: float, hi: float) List[dict] | None
norm(normalizer specs,{"name": ..., ...}) with its MinMaxNormalizer set to the raw’s window [lo, hi], or None: no MinMaxNormalizer, no window (lo = hi), or one not narrower than NARROW_WINDOW of the normalizer’s own range.