mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
raea scene faults train: the judge held out a whole shot at a time
Besides each finding held out, train now fits without each shot and judges it (labels::shots keeps the shot with each verdict): how it does on a scene it hasn't seen. On the 63 verdicts from 3 projects and 13 shots: 51 right (the prior 18), where a replay had put it at 50.
This commit is contained in:
1 parent
9d076c1e3c
commit
ba02f5f5de
4 files changed
+22
-5
No files matched your search
@@ -150,12 +150,24 @@ fn train(root: Option<&str>) -> Result<String, String> {
|
||||
let m = Model::fit(&rest);
|
||||
held += ex.iter().filter(|e| &e.1 == *f && (m.score(&e.0, &e.1) >= FAULT) == (e.2 >= 0.5)).count();
|
||||
}
|
||||
// and a shot at a time (each project's own shot names, so a shot is a project's view): a scene it has never seen
|
||||
let by_shot: Vec<_> = files.iter().enumerate().flat_map(|(n, f)| labels::shots(f).into_iter().map(move |(s, x, t, y)| (format!("{n}/{s}"), x, t, y))).collect();
|
||||
let mut names: Vec<&String> = by_shot.iter().map(|e| &e.0).collect();
|
||||
names.sort();
|
||||
names.dedup();
|
||||
let mut unseen = 0;
|
||||
for s in &names {
|
||||
let rest: Vec<_> = by_shot.iter().filter(|e| &e.0 != *s).map(|e| (e.1.clone(), e.2.clone(), e.3)).collect();
|
||||
let m = Model::fit(&rest);
|
||||
unseen += by_shot.iter().filter(|e| &e.0 == *s && (m.score(&e.1, &e.2) >= FAULT) == (e.3 >= 0.5)).count();
|
||||
}
|
||||
Ok(format!(
|
||||
"{} verdicts on {} findings from {} projects ({real} real, {} fine): the prior agreed with {before}, the fitted judge with {right}, and with {held} each fitted without its own finding (held out); kept in {}\n{}",
|
||||
"{} verdicts on {} findings from {} projects ({real} real, {} fine): the prior agreed with {before}, the fitted judge with {right}, with {held} each fitted without its own finding (held out), and with {unseen} each fitted without its whole shot ({} shots, a scene it hasn't seen); kept in {}\n{}",
|
||||
ex.len(),
|
||||
finds.len(),
|
||||
files.len(),
|
||||
ex.len() - real,
|
||||
names.len(),
|
||||
p.display(),
|
||||
crate::motion::train()?
|
||||
))
|
||||
|
||||
@@ -51,7 +51,7 @@ FAULT) and seen ones under that (maybe), counts the findings no camera sees, and
|
||||
with the finding's key. `--real KEY` and `--fine KEY` keep a verdict beside the project, and a finding the last run
|
||||
reported that is gone while both its parts remain is kept as fixed, so real. `raea scene faults train [FOLDER]` fits
|
||||
the model to every project's verdicts under FOLDER and keeps it in raea's models folder (notice/faults.json), which
|
||||
every run after uses. Until then it judges by a written prior (systems/notice/src/model.rs). See docs/notice.feature.
|
||||
every run after uses. It reports how many verdicts it gets right fitted without each one's finding, and without each one's whole shot (a scene it hasn't seen). Until then it judges by a written prior (systems/notice/src/model.rs). See docs/notice.feature.
|
||||
|
||||
`faults --clip` holds a character's motion to what a body does, frame by frame (raea-sys-motionfaults): a knee that
|
||||
gives and comes back in a snap while its foot stands (a buckle), a standing foot that slides or glides along the
|
||||
|
||||
+2
-2
@@ -224,8 +224,8 @@ Feature: Notice: a 3D scene's faults judged as a viewer of the shot would see th
|
||||
lid, a sign's plate, a desk's top or meat on its tray; hanging lamps "in the air" on their rods; a dress form on its
|
||||
pole). The judge as it stood (22 verdicts, none from gambit) had called nearly all 41 faults, about 2 right: what
|
||||
it had learned from a motel didn't carry to a Berlin shop. Refitted on all 63 (14 real, 49 fine, 3 projects, 13
|
||||
shots), with each gambit shop left out and then judged: 34 of 41 right (a Python replay of the fit, every shot
|
||||
held out in turn: 50 of 63). What it still gets wrong: floats by size (10 mm fine, 30 mm real, a 4 mm hat real;
|
||||
shots), with each gambit shop left out and then judged: 34 of 41 right; every shot held out in turn, as `train`
|
||||
now reports it: 51 of 63 (the prior: 18). What it still gets wrong: floats by size (10 mm fine, 30 mm real, a 4 mm hat real;
|
||||
seven verdicts don't fix a line, and the word "till" learned "fine" from the tills' shared faces), and the
|
||||
drugstore's scale, whose seam is truly hidden (it enters the till's far face) though the jam shows. Tried in the
|
||||
replay and not kept, none beating the fit as it stands by more than a verdict: the gap alone for floats, sunk and
|
||||
|
||||
@@ -106,6 +106,11 @@ pub fn files(root: &Path, depth: usize) -> Vec<PathBuf> {
|
||||
|
||||
/// A file's verdicts as examples, the newest verdict on each finding winning.
|
||||
pub fn examples(file: &Path) -> Vec<(Vec<f32>, Vec<String>, f32)> {
|
||||
shots(file).into_iter().map(|(_, x, t, y)| (x, t, y)).collect()
|
||||
}
|
||||
|
||||
/// The verdicts as `examples` reads them, each with the shot it was given on (for a fit held out a shot at a time).
|
||||
pub fn shots(file: &Path) -> Vec<(String, Vec<f32>, Vec<String>, f32)> {
|
||||
// per shot and key the newest verdict, a person's over a vision model's (`by: "ask"`) whatever their order
|
||||
let mut by: std::collections::BTreeMap<String, (Vec<f32>, Vec<String>, f32, bool)> = Default::default();
|
||||
for line in std::fs::read_to_string(file).unwrap_or_default().lines() {
|
||||
@@ -122,5 +127,5 @@ pub fn examples(file: &Path) -> Vec<(Vec<f32>, Vec<String>, f32)> {
|
||||
}
|
||||
by.insert(key, (x, toks, r["label"].as_f64().unwrap_or(0.0) as f32, asked));
|
||||
}
|
||||
by.into_values().map(|(x, t, y, _)| (x, t, y)).collect()
|
||||
by.into_iter().map(|(k, (x, t, y, _))| (k.split('|').next().unwrap_or("").to_string(), x, t, y)).collect()
|
||||
}
|
||||
Reference in new issue
Block a user