MCPcopy Create free account
hub / github.com/Rex-sys-hk/PlanScope / __init__

Method __init__

src/models/pluto/modules/agent_encoder.py:9–39  ·  view source on GitHub ↗
(
        self,
        state_channel=6,
        history_channel=9,
        dim=128,
        hist_steps=21,
        use_ego_history=False,
        drop_path=0.2,
        state_attn_encoder=True,
        state_dropout=0.75,
    )

Source from the content-addressed store, hash-verified

7
8class AgentEncoder(nn.Module):
9 def __init__(
10 self,
11 state_channel=6,
12 history_channel=9,
13 dim=128,
14 hist_steps=21,
15 use_ego_history=False,
16 drop_path=0.2,
17 state_attn_encoder=True,
18 state_dropout=0.75,
19 ) -> None:
20 super().__init__()
21 self.dim = dim
22 self.state_channel = state_channel
23 self.use_ego_history = use_ego_history
24 self.hist_steps = hist_steps
25 self.state_attn_encoder = state_attn_encoder
26
27 self.history_encoder = NATSequenceEncoder(
28 in_chans=history_channel, embed_dim=dim // 4, drop_path_rate=drop_path
29 )
30
31 if not use_ego_history:
32 if not self.state_attn_encoder:
33 self.ego_state_emb = build_mlp(state_channel, [dim] * 2, norm="bn")
34 else:
35 self.ego_state_emb = StateAttentionEncoder(
36 state_channel, dim, state_dropout
37 )
38
39 self.type_emb = nn.Embedding(4, dim)
40
41 @staticmethod
42 def to_vector(feat, valid_mask):

Callers 1

__init__Method · 0.45

Calls 3

NATSequenceEncoderClass · 0.85
build_mlpFunction · 0.85

Tested by

no test coverage detected