Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
HongyangDu committed Mar 21, 2024
1 parent dadb74f commit 7471fde
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 6 deletions.
Binary file not shown.
Binary file removed benchmark/log/default/ppo/Mar21-203336/policy.pth
Binary file not shown.
Binary file modified diffusion/__pycache__/model.cpython-38.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions diffusion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def forward(self, x, time, state):
t = self.time_mlp(time)
x = torch.cat([x, t, processed_state], dim=1)
x = self.mid_layer(x)
# x = self.final_layer(x)
# return torch.tanh(x)
x = self.final_layer(x)
return x


Expand Down
Binary file modified env/__pycache__/env.cpython-38.pyc
Binary file not shown.
Binary file modified env/__pycache__/utility.cpython-38.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def action_space(self):
@property
def state(self):
# Provide the current state to the agent
states1 = np.random.uniform(13, 14, 50)
states2 = np.random.uniform(0, 0.1, 50)
states1 = np.random.uniform(13, 14, 5)
states2 = np.random.uniform(0, 0.1, 5)
states = np.concatenate([states1, states2])
self._laststate = states
return states
Expand Down
4 changes: 2 additions & 2 deletions env/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def water(s, total_power):
# Function to compute utility (reward) for the given state and action
def CompUtility(State, Aution):
actions = torch.from_numpy(Aution).float()
actions = torch.abs(actions)
# actions = torch.sigmoid(actions)
# actions = torch.abs(actions)
actions = torch.sigmoid(1.5*actions)
Aution = actions.numpy()

total_power = 12
Expand Down
Binary file not shown.
Binary file removed log/default/diffusion/Mar21-203131/policy.pth
Binary file not shown.
Binary file not shown.

0 comments on commit 7471fde

Please sign in to comment.