Skip to content

After CU20 — A run, drawn

live = Live() # in a cell, on its own
t = Trainer(g, objective=..., optimizer=...,
watching=[Recorder(store, summarising=["loss"]), live])
progress(store, run="tuesday") # afterwards, or another machine's
spent(store, run="tuesday", last=200) # where the time went

The presentation half, asked for in the same breath as the reader: “un módulo encargado de leer y presentar al usuario toda la información, de forma independiente y agregada”, and plotly for it, because plotly can redraw in place.

The same figure from two sources, which is the point

Section titled “The same figure from two sources, which is the point”

progress reads a store and Live is handed facts as they happen, and they fill one drawing function. They can, because a fact read back is the very dict a watcher was given — Fact::flattened, once, for everybody. What that buys is not tidiness: a live view and a report that are written twice are two things that slowly stop agreeing, and the one you are watching at three in the morning is the one that is wrong.

Live holds one row per forward and not one per fact, so watching a run for an afternoon costs what the run is long and not what it is wide.

CU19 wrote the rule about the graph — one table, looked up with [] and never with .get(…, default), because the original kept the same strings in four tables and a typo came out as the alarm colour. The moment there was a second figure the same rule applied one level up, so the table moved to somatize._theme and the graph moved with it: a library whose graph is light and whose curves are dark is two libraries.

The discipline survives the move intact: one fact per channel. Hue says where a node ran or which series it is, never good-or-bad. The only red on any of these figures marks a forward that broke, which is a fact in the record and not an opinion about one. Whatever CU21 decides is unhealthy will need a channel of its own, and it does not get to recolour these.

The smooth line is a mean, and that is not a detail

Section titled “The smooth line is a mean, and that is not a detail”

A spline drawn through measured values invents the values between them, and an overshoot on a loss curve dips below a minimum that never happened. The rule about figures here has been the same since CU19 — they may simplify and may not lie — so the bold line is a rolling mean, which is a stated transformation, and the raw series stays underneath it thin and faint. Nothing is hidden by the smoothing: what was measured is on the figure, and what is easy to read admits to being an average.

Centred and not trailing. A trailing mean is the same curve shifted right, and drawn on top of the raw series that shift reads as the smoothing disagreeing with the measurement. Nothing is being predicted — every point of the run is already in hand. It is computed off prefix sums, because a live view redraws it on every step and a window of five hundred over ten thousand points done the obvious way is five million additions a frame.

A forward with no loss said about it is a gap and not a zero: zero on a loss curve reads as the best result of the run.

An edge drawn over a node says something that is not true

Section titled “An edge drawn over a node says something that is not true”

CU19 left this: “the boxes say when, the arrows say what feeds what — and where the nesting stops saying who feeds whom, the arrows are all there is. They were drawn straight, so in exactly that case — the N, a flat Sequencea→c passed through b, which reads as an edge into b.

Now an edge that would cross a box it does not belong to goes around: outside everything, down, and in through the side of what reads it. Outside everything rather than outside the boxes in the way, because a lane threaded between two of them is a lane that will cross a third the next time the layout changes. Whether it would cross is asked exactly, with a slab test — sampling the segment would miss a thin box, and a figure that is usually honest is the kind of thing nobody ever finds.

And one lane per edge: three edges that all have to go around shared one line in the first version, so the figure stopped saying there were three.

The study, drawn — and the figures belong in the library

Section titled “The study, drawn — and the figures belong in the library”

table, influence and coordinates in somatize.study, with importance beside the other readers. They were written in a notebook first and that was wrong: a figure hand-rolled in an example is a figure with no tests, no shared palette, and a second copy the day somebody wants it elsewhere.

importance is Spearman’s ρ — a rank correlation, so it says this knob orders the results and not this knob is worth these many points. It is what the original actually has: its documentation names fANOVA and says it was deferred, and it never arrived. Thirty lines of plain Python, so it is not a dependency. Ranks and not values, so a knob searched in log needs no special case, and 0.0 where a knob never varied — no evidence, which is not the same as no effect.

coordinates draws every finished trial as a curve and not a polyline, which meant not using plotly’s Parcoords at all: it only draws straight segments. What that costs is its brushing; what it buys is that a trial reads as one continuous thing, which is what makes a bundle visible as a bundle. A curve claims nothing — a point exists only where it crosses an axis, and it crosses at the value it has — but it is still drawn gently, because a spline bulging past the top of an axis reads as a value beyond its range even when it means nothing.

goal decides which end of the colour scale is good and it is read from the study, never guessed: getting it backwards is the quietest lie a figure can tell — everything is drawn, nothing raises, and the region you read as promising is the one to stay away from. table sorting the wrong way round is the same lie with a different label, since it says best first either way.

It was a parameter with a default of min, which is the guess in another place. So report writes the direction into the record beside the score — the number does not say which way is better and neither did anything else a reader could reach — and both figures read it, with goal= left as an override for a study run before it was written down. When nobody says at all, they part company: table gives up the claim and falls back to the order the trials ran in, saying so in its title, and coordinates raises, because a colour scale has two ends and drawing one is saying which of them is good.

The cost is one word per record and it is denormalised on purpose — the direction belongs to the study, not the trial. A name of its own would cost a fetch and a missing case, against a normalisation nobody was going to query; and writing it per trial records what was meant at the time, so a study whose direction changed halfway does not retell the old trials.

And in all three, pruned and finished are not ranked together. table shows both with their state; the other two use only what ran to the end, for the same reason finished leaves pruned trials out.

Edges that would cross a node (soma-python/tests/test_figure.py)

  • an edge with something in the way is routed around it
  • one with nothing in the way is still a straight arrow
  • three routed edges do not share one lane
  • a routed edge runs outside every box
  • a segment is tested against a box exactly, not by sampling

Which knob mattered (soma-python/tests/test_study_figure.py)

  • a knob that decides the score comes out near one
  • one that never varied is zero, because that is no evidence
  • a study with nothing to compare says nothing rather than guessing
  • a pruned trial does not vote
  • the biggest comes first

The study, drawn

  • the table shows the pruned ones too, and says which
  • it has a column per knob in the space
  • the influence bars are the numbers importance gives
  • every finished trial is a curve, and a pruned one is not
  • a knob searched over orders of magnitude gets a log axis
  • the goal decides which end of the scale is good
  • a study nobody has finished is a statement and not an exception
  • the table reads the direction the study recorded, both ways round
  • a caller overrides the record for a study that predates it
  • a table that does not know gives up the claim instead of guessing
  • a study that never said raises rather than drawing it backwards
  • a direction nobody recognises is refused by the figure as well

One figure, two sources (soma-python/tests/test_record_figure.py)

  • live and read back draw the same series, point for point
  • a live view keeps one row per forward and not one per fact

The smoothing, which is where a figure could start lying

  • the smoothed line stays inside what was measured
  • the mean is centred and not trailing
  • asking for no smoothing gives back what was measured
  • a forward with no loss is a gap and not a zero

What the figure says happened

  • a forward that broke is marked, and only then is it in the legend
  • the title says what the figure is showing
  • a node is coloured by where it ran and by nothing else

One product

  • the graph and the run are drawn from the same table
  • without plotly, drawing says how to get it
  • a live view outside a notebook reads as nothing, like the graph’s figure