File size: 2,763 Bytes
0107764
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""Configuration of the SetCon model (Hugging Face remote code)."""
from __future__ import annotations

from transformers import PretrainedConfig


class SetConConfig(PretrainedConfig):
    """Sizes of the graph encoder and the calibrator, the fixed input scales and where the weights come from.

    The input scales divide the canonicalized specific force (m/s^2) and angular velocity (rad/s) before the encoder
    and the calibrator see them. They are the per-axis root-mean-square values of simulated joint-center signals on
    500 training clips (paper Eq. 3: kappa_f and kappa_omega).
    """

    model_type = "setcon"

    def __init__(
        self,
        num_sites: int = 22,
        num_patches: int = 50,
        frames_per_patch: int = 4,
        input_channels: int = 9,
        hidden_size: int = 256,
        num_graph_blocks: int = 8,
        temporal_kernel: int = 9,
        embedding_dim: int = 512,
        force_scale: float = 6.2,
        rate_scale: float = 0.74,
        sample_rate_hz: float = 20.0,
        calibrator_hidden_size: int = 128,
        calibrator_conv_channels: tuple = (64, 128, 128, 128),
        calibrator_conv_strides: tuple = (2, 2, 2, 1),
        calibrator_set_blocks: int = 2,
        calibrator_components: int = 2,
        calibrator_body_parts: int = 14,
        calibrator_sides: int = 3,
        context_windows: int = 6,
        text_encoder: str = "openai/clip ViT-B/32 (frozen)",
        training_seed: int = 1,
        stage2_epoch: int = 100,
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.num_sites = int(num_sites)
        self.num_patches = int(num_patches)
        self.frames_per_patch = int(frames_per_patch)
        self.input_channels = int(input_channels)
        self.hidden_size = int(hidden_size)
        self.num_graph_blocks = int(num_graph_blocks)
        self.temporal_kernel = int(temporal_kernel)
        self.embedding_dim = int(embedding_dim)
        self.force_scale = float(force_scale)
        self.rate_scale = float(rate_scale)
        self.sample_rate_hz = float(sample_rate_hz)
        self.calibrator_hidden_size = int(calibrator_hidden_size)
        self.calibrator_conv_channels = [int(c) for c in calibrator_conv_channels]
        self.calibrator_conv_strides = [int(s) for s in calibrator_conv_strides]
        self.calibrator_set_blocks = int(calibrator_set_blocks)
        self.calibrator_components = int(calibrator_components)
        self.calibrator_body_parts = int(calibrator_body_parts)
        self.calibrator_sides = int(calibrator_sides)
        self.context_windows = int(context_windows)
        self.text_encoder = str(text_encoder)
        self.training_seed = int(training_seed)
        self.stage2_epoch = int(stage2_epoch)