gym-examples 3.0.382__py3-none-any.whl → 3.0.384__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.
- gym_examples/__init__.py +1 -1
- gym_examples/envs/wsn_env.py +0 -16
- {gym_examples-3.0.382.dist-info → gym_examples-3.0.384.dist-info}/METADATA +1 -1
- gym_examples-3.0.384.dist-info/RECORD +7 -0
- gym_examples-3.0.382.dist-info/RECORD +0 -7
- {gym_examples-3.0.382.dist-info → gym_examples-3.0.384.dist-info}/WHEEL +0 -0
- {gym_examples-3.0.382.dist-info → gym_examples-3.0.384.dist-info}/top_level.txt +0 -0
gym_examples/__init__.py
CHANGED
gym_examples/envs/wsn_env.py
CHANGED
@@ -28,22 +28,6 @@ latency_per_hop = 1 # latency per hop in seconds
|
|
28
28
|
base_back_up_dir = "results/data/"
|
29
29
|
max_reward = 1 # maximum reward value when the sensors sent data to the base station. The opposite value is when the sensors perform an unauthorized action
|
30
30
|
|
31
|
-
# Define the final reward function using an attention mechanism
|
32
|
-
# class CustomizedLinear(nn.Module):
|
33
|
-
# def __init__(self, input_dim, output_dim):
|
34
|
-
# super(CustomizedLinear, self).__init__()
|
35
|
-
# self.weight = nn.Parameter(torch.rand(output_dim, input_dim))
|
36
|
-
# self.bias = None # No bias term
|
37
|
-
|
38
|
-
# def forward(self, x):
|
39
|
-
# # Normalize cols to ensure that if sum(x1) < sum(x2) ==> sum(Ax1 + 0) < sum(Ax2 + 0): proof in the paper
|
40
|
-
# col_sums = self.weight.sum(dim=0, keepdim=True)
|
41
|
-
# normalized_weight = self.weight / col_sums
|
42
|
-
|
43
|
-
# # Output
|
44
|
-
# y = torch.matmul(x, normalized_weight.t())
|
45
|
-
# return y
|
46
|
-
|
47
31
|
class Attention(nn.Module):
|
48
32
|
def __init__(self, input_dim, output_dim):
|
49
33
|
super(Attention, self).__init__() # Call the initializer of the parent class (nn.Module)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
gym_examples/__init__.py,sha256=6XfSg3eaBIzT8jrp7GxTQWnyqAJbCs99am3-jKUyqIY,166
|
2
|
+
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
+
gym_examples/envs/wsn_env.py,sha256=gBivBdA4h4aG10PimVWmc43FMkfFZYP1Pup2NXFtOck,26284
|
4
|
+
gym_examples-3.0.384.dist-info/METADATA,sha256=uqWT0QidFuRttC08lKdDHUoZB24dul019nQzcpLdhqQ,412
|
5
|
+
gym_examples-3.0.384.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
+
gym_examples-3.0.384.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
+
gym_examples-3.0.384.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
gym_examples/__init__.py,sha256=SKf7IuU2P1gbHgkHXD54TRqBlx4_ug1Qmd4v2gdOyU4,166
|
2
|
-
gym_examples/envs/__init__.py,sha256=lgMe4pyOuUTgTBUddM0iwMlETsYTwFShny6ifm8PGM8,53
|
3
|
-
gym_examples/envs/wsn_env.py,sha256=hztIM8JfhyLW0uNbNBB3n4dwXTrnbAkKsY5TJlRgaD8,26990
|
4
|
-
gym_examples-3.0.382.dist-info/METADATA,sha256=9rX-2ubtcNtAZ2ARR0W4tr_4M5ddC1CmpQfKxLeL0nM,412
|
5
|
-
gym_examples-3.0.382.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
6
|
-
gym_examples-3.0.382.dist-info/top_level.txt,sha256=rJRksoAF32M6lTLBEwYzRdo4PgtejceaNnnZ3HeY_Rk,13
|
7
|
-
gym_examples-3.0.382.dist-info/RECORD,,
|
File without changes
|
File without changes
|