generated from rochacbruno/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Implement graph neural networks. Fixes in replay buffer storage
- Loading branch information
Showing
24 changed files
with
445 additions
and
220 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
|
||
from .layer import Layer | ||
|
||
from .linear import Linear | ||
from .common import Flatten, InstanceNorm, LayerNorm | ||
from .activation import Activation | ||
from .merge import Merge | ||
from .graph import GraphLayer | ||
from .partial_instance_norm_1d import PartialInstanceNorm1d | ||
|
||
from utils import from_cli | ||
from functools import partial | ||
|
||
key_to_class = { | ||
'linear': Linear, | ||
'flatten': Flatten, | ||
'activation': Activation, | ||
'layer_norm': LayerNorm, | ||
'instance_norm': InstanceNorm, | ||
'partial_instance_norm': PartialInstanceNorm1d, | ||
'noisy_linear': ..., | ||
'graph': GraphLayer, | ||
'merge': merge | ||
} | ||
|
||
from_cli = partial(from_cli, key_to_class=key_to_class) | ||
|
||
from .linear import Linear | ||
from .cli import from_cli |
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 @@ | ||
|
||
def from_cli(*args, **kwargs): | ||
from .linear import Linear | ||
from .common import Flatten, InstanceNorm, LayerNorm | ||
from .activation import Activation | ||
from .merge import Merge | ||
from .graph_model import GraphModel | ||
from .graph_layer import common_graph_layer, common_operation | ||
from .partial_instance_norm_1d import PartialInstanceNorm1d | ||
|
||
from utils import from_cli as from_cli_ | ||
|
||
import torch_geometric as pyg | ||
|
||
key_to_class = { | ||
'flatten': Flatten, | ||
'merge': Merge, | ||
'activation': Activation, | ||
|
||
'linear': Linear, | ||
'layer_norm': LayerNorm, | ||
'instance_norm': InstanceNorm, | ||
'partial_instance_norm': PartialInstanceNorm1d, | ||
'noisy_linear': ..., | ||
|
||
'graph_model': GraphModel, | ||
'gin': common_graph_layer(pyg.nn.GINConv), | ||
'sage': common_graph_layer(pyg.nn.SAGEConv), | ||
'gat': common_graph_layer(pyg.nn.GATConv), | ||
'gcn': common_graph_layer(pyg.nn.GCNConv), | ||
'deep_gcn': common_graph_layer(pyg.nn.DeepGCNLayer), | ||
|
||
'add_pool': common_operation(pyg.nn.global_add_pool), | ||
} | ||
|
||
return from_cli_(*args, **kwargs, key_to_class=key_to_class) |
Oops, something went wrong.