Skip to content

Commit 27ae2da

Browse files
authored
Remove unneccessary Random in EMG example (#156)
The EMG hand gestures example uses a Random embedding to encode the timestamp. However, the paper does not use such embedding and the timing is encoded by permuting the spatial samples.
1 parent 2de23fd commit 27ae2da

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

examples/emg_hand_gestures.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ def __init__(self, out_features, timestamps, channels):
3333
super(Encoder, self).__init__()
3434

3535
self.channels = embeddings.Random(channels, out_features)
36-
self.timestamps = embeddings.Random(timestamps, out_features)
3736
self.signals = embeddings.Level(NUM_LEVELS, out_features, high=20)
3837

3938
def forward(self, input: torch.Tensor) -> torch.Tensor:
4039
signal = self.signals(input)
4140
samples = torchhd.bind(signal, self.channels.weight.unsqueeze(0))
42-
samples = torchhd.bind(samples, self.timestamps.weight.unsqueeze(1))
4341

4442
samples = torchhd.multiset(samples)
4543
sample_hv = torchhd.ngrams(samples, n=N_GRAM_SIZE)

0 commit comments

Comments
 (0)