imt-ring 1.4.0__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {imt_ring-1.4.0.dist-info → imt_ring-1.5.0.dist-info}/METADATA +1 -1
- {imt_ring-1.4.0.dist-info → imt_ring-1.5.0.dist-info}/RECORD +21 -19
- {imt_ring-1.4.0.dist-info → imt_ring-1.5.0.dist-info}/WHEEL +1 -1
- ring/__init__.py +34 -10
- ring/algorithms/__init__.py +1 -11
- ring/algorithms/generator/__init__.py +2 -16
- ring/algorithms/generator/base.py +242 -276
- ring/algorithms/generator/batch.py +26 -109
- ring/algorithms/generator/finalize_fns.py +306 -0
- ring/algorithms/generator/motion_artifacts.py +17 -19
- ring/algorithms/generator/setup_fns.py +43 -0
- ring/algorithms/generator/types.py +3 -18
- ring/algorithms/jcalc.py +0 -9
- ring/ml/base.py +6 -2
- ring/ml/params/0x1d76628065a71e0f.pickle +0 -0
- ring/rendering/mujoco_render.py +2 -1
- ring/utils/__init__.py +3 -4
- ring/utils/batchsize.py +12 -4
- ring/utils/utils.py +6 -0
- ring/algorithms/generator/transforms.py +0 -411
- {imt_ring-1.4.0.dist-info → imt_ring-1.5.0.dist-info}/top_level.txt +0 -0
- /ring/{algorithms/generator/randomize.py → utils/randomize_sys.py} +0 -0
@@ -1,26 +1,26 @@
|
|
1
|
-
ring/__init__.py,sha256
|
1
|
+
ring/__init__.py,sha256=2v6WHlNPucj1XGhDYw-3AlMQGTqH-e4KYK0IaMnBV5s,4760
|
2
2
|
ring/algebra.py,sha256=F0GwbP8LQP5qGVkoMUYJmkp9Hn2nKAVIkCVYDEjNjGU,3128
|
3
3
|
ring/base.py,sha256=YFPrUWelWswEhq8x8Byv-5pK64mipiGW6x5IlMr4we4,33803
|
4
4
|
ring/maths.py,sha256=jJr_kr78-XDce8B4tXQ2Li-jBntVQhaS8csxglCsj8A,12193
|
5
5
|
ring/spatial.py,sha256=nmZ-UhRanhyM34bez8uCS4wMwaKqLkuEbgKGP5XNH60,2351
|
6
|
-
ring/algorithms/__init__.py,sha256=
|
6
|
+
ring/algorithms/__init__.py,sha256=IiK9EN5Xgs3dB075-A-H-Yad0Z7vzvKIJF2g6X_-C_8,1224
|
7
7
|
ring/algorithms/_random.py,sha256=M9JQSMXSUARWuzlRLP3Wmkuntrk9LZpP30p4_IPgDB4,13805
|
8
8
|
ring/algorithms/dynamics.py,sha256=_TwclBXe6vi5C5iJWAIeUIJEIMHQ_1QTmnHvCEpVO0M,10867
|
9
|
-
ring/algorithms/jcalc.py,sha256=
|
9
|
+
ring/algorithms/jcalc.py,sha256=seis_VQwSvyrZBtmgKwAgSfT_fhXT4Gcyufp0KCUBME,28094
|
10
10
|
ring/algorithms/kinematics.py,sha256=DOboHI517Vx0pRJUFZtZPmK_qFaiKiQe-37B-M0aC-c,7422
|
11
11
|
ring/algorithms/sensors.py,sha256=MICO9Sn0AfoqRx_9KWR3hufsIID-K6SOIg3oPDgsYMU,17869
|
12
12
|
ring/algorithms/custom_joints/__init__.py,sha256=fzeE7TdUhmGgbbFAyis1tKcyQ4Fo8LigDwD3hUVnH_w,316
|
13
13
|
ring/algorithms/custom_joints/rr_imp_joint.py,sha256=a3JT0w7pB94kZ95eBR8ZO853eSeyjFoiXmhYlaXoHDE,2392
|
14
14
|
ring/algorithms/custom_joints/rr_joint.py,sha256=jnRtjtOCALMaq2_0bcu2d7qgfQ6etXpoh43MioRaDmY,1000
|
15
15
|
ring/algorithms/custom_joints/suntay.py,sha256=7-kym1kMDwqYD_2um1roGcBeB8BlTCPe1wljuNGNARA,16676
|
16
|
-
ring/algorithms/generator/__init__.py,sha256=
|
17
|
-
ring/algorithms/generator/base.py,sha256=
|
18
|
-
ring/algorithms/generator/batch.py,sha256=
|
19
|
-
ring/algorithms/generator/
|
16
|
+
ring/algorithms/generator/__init__.py,sha256=bF-CW3x2x-o6KWESKy-DuxzZPh3UNSjJb_MaAcSHGsQ,277
|
17
|
+
ring/algorithms/generator/base.py,sha256=1rzClXZ0WMJ_IZroTO9i1aWiHBy7whsCrJLIMY4zC3c,13280
|
18
|
+
ring/algorithms/generator/batch.py,sha256=Hwh5jYZQEmkx73YaXjWd6sZdikmj43spE7DCzGDHXtE,6637
|
19
|
+
ring/algorithms/generator/finalize_fns.py,sha256=0fbtwQw89_w0ytQ_aJ877CZGY5fbtb8sbsRO0O8pT34,9081
|
20
|
+
ring/algorithms/generator/motion_artifacts.py,sha256=vzBLlG60KCAa7Zj1RdUiRkoOx_3inA_2M1mBKl3lTKs,8834
|
20
21
|
ring/algorithms/generator/pd_control.py,sha256=XJ_Gd5AkIRh-jBrMfQyMXjVwhx2gCNHznjzFbmAwhZs,5767
|
21
|
-
ring/algorithms/generator/
|
22
|
-
ring/algorithms/generator/
|
23
|
-
ring/algorithms/generator/types.py,sha256=CAhvDK5qiHnrGtkCVccB07doiz_D6lHJ35B7sW0pyZA,1110
|
22
|
+
ring/algorithms/generator/setup_fns.py,sha256=MFz3czHBeWs1Zk1A8O02CyQpQ-NCyW9PMpbqmKit6es,1455
|
23
|
+
ring/algorithms/generator/types.py,sha256=HjNyATFSLfHkXlzdJhvUkiqnhzpXFDDXmWS3LYBlOtU,721
|
24
24
|
ring/io/__init__.py,sha256=1gEJdyDCbldbbm8QeZbLmhzSKmaQ-UqTmQgu4DBH2Z4,328
|
25
25
|
ring/io/examples.py,sha256=KLf2iCagvRfjs9MCnQsLUlfGBjrQKrD-Qv8U0TtX6Ek,1114
|
26
26
|
ring/io/test_examples.py,sha256=htpnSgLG9Fi9_qwSL4F1yLi9sN7ZUrF8dDmiqU3B510,117
|
@@ -51,7 +51,7 @@ ring/io/xml/test_from_xml.py,sha256=bckVrVVmEhCwujd_OF9FGYnX3zU3BgztpqGxxmd0htM,
|
|
51
51
|
ring/io/xml/test_to_xml.py,sha256=NGn4VSiFdwhYN5YTBduWMiY9B5dwtxZhCQAR_PXeqKU,946
|
52
52
|
ring/io/xml/to_xml.py,sha256=fohb-jWMf2cxVdT5dmknsGyrNMseICSbKEz_urbaWbQ,3407
|
53
53
|
ring/ml/__init__.py,sha256=8SZTCs9rJ1kzR0Psh7lUzFhIMhKRPIK41mVfxJAGyMo,1471
|
54
|
-
ring/ml/base.py,sha256
|
54
|
+
ring/ml/base.py,sha256=-3JQ27zMFESNn5zeNer14GJU2yQgiqDcJUaULOeSyp8,9799
|
55
55
|
ring/ml/callbacks.py,sha256=W19QF6_uvaNCjs8ObsjNXD7mv9gFgJBixdRSbB_BynE,13301
|
56
56
|
ring/ml/ml_utils.py,sha256=hQEmeZoahdJyFrz0NZXYi1Yijl7GvPBdqwzZBzlUIUM,7638
|
57
57
|
ring/ml/optimizer.py,sha256=fWyF__ezUltrA16SLfOC1jvS3zBh9NJsMYa6-V0frhs,4709
|
@@ -60,9 +60,10 @@ ring/ml/rnno_v1.py,sha256=T4SKG7iypqn2HBQLKhDmJ2Slj2Z5jtUBHvX_6aL8pyM,1103
|
|
60
60
|
ring/ml/train.py,sha256=huUfMK6eotS6BRrQKoZ-AUG0um3jlqpfQFZNJT8LKiE,10854
|
61
61
|
ring/ml/training_loop.py,sha256=CEokvPQuuk_WCd-J60ZDodJYcPVvyxLfgXDr_DnbzRI,3359
|
62
62
|
ring/ml/params/0x13e3518065c21cd8.pickle,sha256=Zh2k1zK-TNxJl5F7nyTeQ9001qqRE_dfvaq1HWV287A,9355838
|
63
|
+
ring/ml/params/0x1d76628065a71e0f.pickle,sha256=YTNVuvfw-nCRD9BH1PZYcR9uCFpNWDhw8Lc50eDn_EE,9351038
|
63
64
|
ring/rendering/__init__.py,sha256=Zf7qOdzK3t2hljIrs5P4zFhzHljLSMRyDDZO2YlZk4k,75
|
64
65
|
ring/rendering/base_render.py,sha256=s5dF-GVBqjiWkqVuPQMtTLuM7EtA-YrB7RVWFfIaQ1I,8956
|
65
|
-
ring/rendering/mujoco_render.py,sha256=
|
66
|
+
ring/rendering/mujoco_render.py,sha256=uZ-6s6vshsc49N4xvh5KEWQo1f0DveoZqlJ6sIy1QGI,7912
|
66
67
|
ring/rendering/vispy_render.py,sha256=QmRyA7Hqk3uS1SKjcncwc4_vd1m4yWryW2X0i4jRvCw,10260
|
67
68
|
ring/rendering/vispy_visuals.py,sha256=ooBZqppnebeL0ANe6V6zUgnNTtDcdkOsa4vZuM4sx-I,7873
|
68
69
|
ring/sim2real/__init__.py,sha256=gCLYg8IoMdzUagzhCFcfjZ5GavtIU772L7HR0G5hUtM,251
|
@@ -71,15 +72,16 @@ ring/sys_composer/__init__.py,sha256=5J_JJJIHfTPcpxh0v4FqiOs81V1REPUd7pgiw2nAN5E
|
|
71
72
|
ring/sys_composer/delete_sys.py,sha256=cIM9KbyLfg7B9121g7yjzuFbjeNu9cil1dPavAYEgzk,3408
|
72
73
|
ring/sys_composer/inject_sys.py,sha256=Mj-q-mUjXKwkg-ol6IQAjf9IJfk7pGhez0_WoTKTgm0,3503
|
73
74
|
ring/sys_composer/morph_sys.py,sha256=2GpPtS5hT0eZMptdGpt30Hc97OykJNE67lEVRf7sHrc,12700
|
74
|
-
ring/utils/__init__.py,sha256=
|
75
|
+
ring/utils/__init__.py,sha256=9ZEooVyri0IWXHA5T-L03vP7aWX0zo8qvfNioGnIAkc,696
|
75
76
|
ring/utils/backend.py,sha256=cKSi9sB59texqKzNVASTDczGKLCBL8VVDiP7TNdj41k,1294
|
76
|
-
ring/utils/batchsize.py,sha256=
|
77
|
+
ring/utils/batchsize.py,sha256=FbOii7MDP4oPZd9GJOKehFatfnb6WZ0b9z349iZYs1A,1786
|
77
78
|
ring/utils/colab.py,sha256=ZLHwP0jNQUsmZJU4l68a5djULPi6T-jYNNHevjIoMn8,1631
|
78
79
|
ring/utils/hdf5.py,sha256=BzXwVypZmEZeHVgeGZ78YYdi10NEQtnPhdrb8dQAXo0,5856
|
79
80
|
ring/utils/normalizer.py,sha256=67L2BU1MRsMT4pD41ta3JJMppLN0ozFmnwrmXDtnqrQ,1698
|
80
81
|
ring/utils/path.py,sha256=hAfSlqRi-ew536RnjDDM7IKapdMJc-EvhrR0Y-BCFWc,1265
|
81
|
-
ring/utils/
|
82
|
-
|
83
|
-
imt_ring-1.
|
84
|
-
imt_ring-1.
|
85
|
-
imt_ring-1.
|
82
|
+
ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3699
|
83
|
+
ring/utils/utils.py,sha256=VkB0Gvmlaz2MZdntgjWA0rOpRkvIRpLWRFgIofoY7hs,5441
|
84
|
+
imt_ring-1.5.0.dist-info/METADATA,sha256=ZjJMt4357zV4eK-ZKH_d4Q7nhc8dJ6RG_AnocvzDNzU,3104
|
85
|
+
imt_ring-1.5.0.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
86
|
+
imt_ring-1.5.0.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
87
|
+
imt_ring-1.5.0.dist-info/RECORD,,
|
ring/__init__.py
CHANGED
@@ -20,11 +20,11 @@ from .base import System
|
|
20
20
|
from .base import Transform
|
21
21
|
|
22
22
|
|
23
|
-
def RING(lam: list[int], Ts: float | None):
|
23
|
+
def RING(lam: list[int] | None, Ts: float | None, **kwargs):
|
24
24
|
"""Creates the RING network.
|
25
25
|
|
26
26
|
Params:
|
27
|
-
lam: parent array
|
27
|
+
lam: parent array, if `None` must be given via `ringnet.apply(..., lam=lam)`
|
28
28
|
Ts : sampling interval of IMU data; time delta in seconds
|
29
29
|
|
30
30
|
Usage:
|
@@ -55,6 +55,7 @@ def RING(lam: list[int], Ts: float | None):
|
|
55
55
|
>>>
|
56
56
|
>>> yhat, _ = ringnet.apply(X)
|
57
57
|
>>> # yhat : unit quaternions, shape = (B, T_i, N, 4)
|
58
|
+
>>> # yhat[b, :, i] is the orientation from body `i` to parent body `lam[i]`
|
58
59
|
>>>
|
59
60
|
>>> # use `jax.jit` to compile the forward pass
|
60
61
|
>>> jit_apply = jax.jit(ringnet.apply)
|
@@ -69,21 +70,44 @@ def RING(lam: list[int], Ts: float | None):
|
|
69
70
|
from pathlib import Path
|
70
71
|
import warnings
|
71
72
|
|
72
|
-
|
73
|
+
config = dict(
|
74
|
+
use_100Hz_RING=True,
|
75
|
+
use_lpf=True,
|
76
|
+
lpf_cutoff_freq=ml._LPF_CUTOFF_FREQ,
|
77
|
+
)
|
78
|
+
config.update(kwargs)
|
79
|
+
|
80
|
+
if Ts is not None and (Ts > (1 / 40) or Ts < (1 / 200)):
|
73
81
|
warnings.warn(
|
74
82
|
"RING was only trained on sampling rates between 40 to 200 Hz "
|
75
83
|
f"but found {1 / Ts}Hz"
|
76
84
|
)
|
77
85
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
86
|
+
if Ts is not None and Ts == 0.01 and config["use_100Hz_RING"]:
|
87
|
+
# this set of parameters was trained exclusively on 100Hz data; it also
|
88
|
+
# expects F=9 features per node and not F=10 where the last features is
|
89
|
+
# the sampling interval Ts
|
90
|
+
params = Path(__file__).parent.joinpath("ml/params/0x1d76628065a71e0f.pickle")
|
91
|
+
add_Ts = False
|
92
|
+
else:
|
93
|
+
# this set of parameters was trained on sampling rates from 40 to 200 Hz
|
94
|
+
params = Path(__file__).parent.joinpath("ml/params/0x13e3518065c21cd8.pickle")
|
95
|
+
add_Ts = True
|
96
|
+
|
97
|
+
ringnet = ml.RING(
|
98
|
+
params=params, lam=None if lam is None else tuple(lam), jit=False, name="RING"
|
84
99
|
)
|
100
|
+
ringnet = ml.base.ScaleX_FilterWrapper(ringnet)
|
101
|
+
if config["use_lpf"]:
|
102
|
+
ringnet = ml.base.LPF_FilterWrapper(
|
103
|
+
ringnet,
|
104
|
+
config["lpf_cutoff_freq"],
|
105
|
+
samp_freq=None if Ts is None else 1 / Ts,
|
106
|
+
quiet=True,
|
107
|
+
)
|
85
108
|
ringnet = ml.base.GroundTruthHeading_FilterWrapper(ringnet)
|
86
|
-
|
109
|
+
if add_Ts:
|
110
|
+
ringnet = ml.base.AddTs_FilterWrapper(ringnet, Ts)
|
87
111
|
return ringnet
|
88
112
|
|
89
113
|
|
ring/algorithms/__init__.py
CHANGED
@@ -10,21 +10,11 @@ from .dynamics import compute_mass_matrix
|
|
10
10
|
from .dynamics import forward_dynamics
|
11
11
|
from .dynamics import inverse_dynamics
|
12
12
|
from .dynamics import step
|
13
|
-
from .generator import batch_generators_eager
|
14
|
-
from .generator import batch_generators_eager_to_list
|
15
|
-
from .generator import batch_generators_lazy
|
16
|
-
from .generator import batched_generator_from_list
|
17
|
-
from .generator import batched_generator_from_paths
|
18
13
|
from .generator import FINALIZE_FN
|
19
14
|
from .generator import Generator
|
20
|
-
from .generator import GeneratorPipe
|
21
|
-
from .generator import GeneratorTrafo
|
22
|
-
from .generator import GeneratorTrafoExpandFlatten
|
23
|
-
from .generator import GeneratorTrafoRandomizePositions
|
24
|
-
from .generator import GeneratorTrafoRemoveInputExtras
|
25
|
-
from .generator import GeneratorTrafoRemoveOutputExtras
|
26
15
|
from .generator import RCMG
|
27
16
|
from .generator import SETUP_FN
|
17
|
+
from .generator.finalize_fns import GeneratorTrafoExpandFlatten
|
28
18
|
from .jcalc import get_joint_model
|
29
19
|
from .jcalc import jcalc_motion
|
30
20
|
from .jcalc import jcalc_tau
|
@@ -1,25 +1,11 @@
|
|
1
1
|
from . import base
|
2
2
|
from . import batch
|
3
|
+
from . import finalize_fns
|
3
4
|
from . import motion_artifacts
|
4
5
|
from . import pd_control
|
5
|
-
from . import
|
6
|
-
from . import transforms
|
6
|
+
from . import setup_fns
|
7
7
|
from . import types
|
8
|
-
from .base import GeneratorPipe
|
9
|
-
from .base import GeneratorTrafoRemoveInputExtras
|
10
|
-
from .base import GeneratorTrafoRemoveOutputExtras
|
11
8
|
from .base import RCMG
|
12
|
-
from .batch import batch_generators_eager
|
13
|
-
from .batch import batch_generators_eager_to_list
|
14
|
-
from .batch import batch_generators_lazy
|
15
|
-
from .batch import batched_generator_from_list
|
16
|
-
from .batch import batched_generator_from_paths
|
17
|
-
from .randomize import randomize_anchors
|
18
|
-
from .randomize import randomize_hz
|
19
|
-
from .randomize import randomize_hz_finalize_fn_factory
|
20
|
-
from .transforms import GeneratorTrafoExpandFlatten
|
21
|
-
from .transforms import GeneratorTrafoRandomizePositions
|
22
9
|
from .types import FINALIZE_FN
|
23
10
|
from .types import Generator
|
24
|
-
from .types import GeneratorTrafo
|
25
11
|
from .types import SETUP_FN
|