forked from VSharp-team/VSharp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from Anya497/optuna
Optuna
- Loading branch information
Showing
5 changed files
with
128 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
VSharp.ML.AIAgent/ml/models/RGCNEdgeTypeTAG2VerticesDouble/model_modified.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from torch_geometric.nn import Linear | ||
from torch.nn.functional import softmax | ||
from .model import StateModelEncoder | ||
|
||
|
||
class StateModelEncoderLastLayer(StateModelEncoder): | ||
def __init__(self, hidden_channels, out_channels): | ||
super().__init__(hidden_channels, out_channels) | ||
self.lin_last = Linear(out_channels, 1) | ||
|
||
def forward( | ||
self, | ||
game_x, | ||
state_x, | ||
edge_index_v_v, | ||
edge_type_v_v, | ||
edge_index_history_v_s, | ||
edge_attr_history_v_s, | ||
edge_index_in_v_s, | ||
edge_index_s_s, | ||
): | ||
return softmax( | ||
self.lin_last( | ||
super().forward( | ||
game_x=game_x, | ||
state_x=state_x, | ||
edge_index_v_v=edge_index_v_v, | ||
edge_type_v_v=edge_type_v_v, | ||
edge_index_history_v_s=edge_index_history_v_s, | ||
edge_attr_history_v_s=edge_attr_history_v_s, | ||
edge_index_in_v_s=edge_index_in_v_s, | ||
edge_index_s_s=edge_index_s_s, | ||
) | ||
), | ||
dim=0, | ||
) |
36 changes: 36 additions & 0 deletions
36
VSharp.ML.AIAgent/ml/models/RGCNEdgeTypeTAG3SageDouble/model_modified.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from torch_geometric.nn import Linear | ||
from torch.nn.functional import softmax | ||
from .model import StateModelEncoder | ||
|
||
|
||
class StateModelEncoderLastLayer(StateModelEncoder): | ||
def __init__(self, hidden_channels, out_channels): | ||
super().__init__(hidden_channels, out_channels) | ||
self.lin_last = Linear(out_channels, 1) | ||
|
||
def forward( | ||
self, | ||
game_x, | ||
state_x, | ||
edge_index_v_v, | ||
edge_type_v_v, | ||
edge_index_history_v_s, | ||
edge_attr_history_v_s, | ||
edge_index_in_v_s, | ||
edge_index_s_s, | ||
): | ||
return softmax( | ||
self.lin_last( | ||
super().forward( | ||
game_x=game_x, | ||
state_x=state_x, | ||
edge_index_v_v=edge_index_v_v, | ||
edge_type_v_v=edge_type_v_v, | ||
edge_index_history_v_s=edge_index_history_v_s, | ||
edge_attr_history_v_s=edge_attr_history_v_s, | ||
edge_index_in_v_s=edge_index_in_v_s, | ||
edge_index_s_s=edge_index_s_s, | ||
) | ||
), | ||
dim=0, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters