File size: 1,552 Bytes
7738b02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# SVG runtime code

`svg_term.py` is imported by `train_online.py` as a TOP-LEVEL module (`from svg_term import SvgTerm`),
so `0811/` must be on `PYTHONPATH` — it is not a package.

It then resolves its dynamics model by **path**, not by import:

    ROOT          = $HDR_ROOT           (default /home/chomeed/workspace/hdr_robot)
    DYNAMICS_DIR  = $ROOT/0810_dyanmics_model
    checkpoint    = $DYNAMICS_DIR/dynamics_<model_tag>.pt
    sys.path gets [DYNAMICS_DIR, $ROOT/0810, $ROOT] prepended

The module for a tag is chosen by PREFIX (svg_term.py:214):

    model_gaussian | model_flow | model_history | model_residual | model_rnn   -> that file
    anything else                                                             -> model.py

So `--svg-dynamics model_flow_threadfull` loads `model_flow.py` and
`dynamics_model_flow_threadfull.pt`, both included here.

## Layout to reproduce

    $HDR_ROOT/0811/svg_term.py
    $HDR_ROOT/0810_dyanmics_model/model*.py
    $HDR_ROOT/0810_dyanmics_model/dynamics_model_flow_threadfull.pt
    $HDR_ROOT/0810/                       # created empty is fine; only sys.path uses it

In the original tree `0811`, `0810` and `0810_dyanmics_model` are SYMLINKS into
`/scratch2/...`, which is why a snapshot of the repo yields dangling links.
Set `HDR_ROOT` to wherever you place these, or make real directories.

## Dependencies

`svg_term.py` needs only numpy + torch, plus `online_rl_mimicgen.dino_wm.pool_features`
on the feature-space path (`--svg-dynamics dino_wm`). The `model_*.py` files are torch-only.