-
-
Notifications
You must be signed in to change notification settings - Fork 120
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 #356 from WenjieDu/(refactor)update_templates
Update the templates
- Loading branch information
Showing
16 changed files
with
284 additions
and
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
The implementation of YourNewModel for the partially-observed time-series classification task. | ||
Refer to the paper "Your paper citation". | ||
""" | ||
|
||
# Created by Your Name <Your contact email> TODO: modify the author information. | ||
# License: BSD-3-Clause | ||
|
||
import torch.nn as nn | ||
|
||
# from ...nn.modules import some_modules | ||
|
||
|
||
# TODO: define your new model here. | ||
# It could be a neural network model or a non-neural network algorithm (e.g. written in numpy). | ||
# Your model should be implemented with PyTorch and subclass torch.nn.Module if it is a neural network. | ||
# Note that your main algorithm is defined in this class, and this class usually won't be exposed to users. | ||
class _YourNewModel(nn.Module): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
# TODO: define your model's components here. If modules in pypots.nn.modules can be reused in your model, | ||
# you can import them and use them here. AND if you think the modules you implemented can be reused by | ||
# other models, you can also consider to contribute them to pypots.nn.modules | ||
self.embedding = nn.Module | ||
self.submodule = nn.Module | ||
self.backbone = nn.Module | ||
|
||
def forward(self, inputs: dict) -> dict: | ||
# TODO: define your model's forward propagation process here. | ||
# The input is a dict, and the output `results` should also be a dict. | ||
output = self.backbone() # replace this with your model's process | ||
|
||
# TODO: `results` must contains the key `loss` which is will be used for | ||
# backward propagation to update the model. | ||
loss = None | ||
results = { | ||
"loss": loss, | ||
} | ||
return results |
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 was deleted.
Oops, something went wrong.
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,42 @@ | ||
""" | ||
The implementation of YourNewModel for the partially-observed time-series clustering task. | ||
Refer to the paper "Your paper citation". | ||
""" | ||
|
||
# Created by Your Name <Your contact email> TODO: modify the author information. | ||
# License: BSD-3-Clause | ||
|
||
import torch.nn as nn | ||
|
||
# from ...nn.modules import some_modules | ||
|
||
|
||
# TODO: define your new model here. | ||
# It could be a neural network model or a non-neural network algorithm (e.g. written in numpy). | ||
# Your model should be implemented with PyTorch and subclass torch.nn.Module if it is a neural network. | ||
# Note that your main algorithm is defined in this class, and this class usually won't be exposed to users. | ||
class _YourNewModel(nn.Module): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
# TODO: define your model's components here. If modules in pypots.nn.modules can be reused in your model, | ||
# you can import them and use them here. AND if you think the modules you implemented can be reused by | ||
# other models, you can also consider to contribute them to pypots.nn.modules | ||
self.embedding = nn.Module | ||
self.submodule = nn.Module | ||
self.backbone = nn.Module | ||
|
||
def forward(self, inputs: dict) -> dict: | ||
# TODO: define your model's forward propagation process here. | ||
# The input is a dict, and the output `results` should also be a dict. | ||
output = self.backbone() # replace this with your model's process | ||
|
||
# TODO: `results` must contains the key `loss` which is will be used for | ||
# backward propagation to update the model. | ||
loss = None | ||
results = { | ||
"loss": loss, | ||
} | ||
return results |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.