-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
44 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from .framework import * | ||
from .torch import * |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import torch | ||
from .framework import FrameworkTransform | ||
from ..transform import FrameworkTransform | ||
|
||
|
||
class TorchFrameworkTransform(FrameworkTransform): | ||
def __call__(self, representation): | ||
def transform(self, representation): | ||
return torch.tensor(representation) |
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,2 +1 @@ | ||
from .representation import * | ||
from .point import * |
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,6 +1,6 @@ | ||
from .representation import RepresentationTransform | ||
from ..transform import RepresentationTransform | ||
|
||
|
||
class PointRepresentationTransform(RepresentationTransform): | ||
def __call__(self, protein): | ||
def transform(self, protein): | ||
return protein["coords"] |
5 changes: 0 additions & 5 deletions
5
proteinshake/frontend/transforms/representation/representation.py
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 |
---|---|---|
@@ -1,19 +1,38 @@ | ||
class Transform: | ||
def fit(self, x): | ||
pass | ||
|
||
def transform(self, x): | ||
return x | ||
|
||
def __call__(self, *args, **kwargs): | ||
return self.transform(*args, **kwargs) | ||
|
||
|
||
class RepresentationTransform(Transform): | ||
pass | ||
|
||
|
||
class FrameworkTransform(Transform): | ||
pass | ||
|
||
|
||
class DataTransform: | ||
def __init__(self, representation_transform, framework_transform): | ||
class DataTransform(Transform): | ||
def __init__( | ||
self, | ||
representation_transform=RepresentationTransform(), | ||
framework_transform=FrameworkTransform(), | ||
): | ||
self.representation_transform = representation_transform | ||
self.framework_transform = framework_transform | ||
|
||
def __call__(self, x): | ||
def transform(self, x): | ||
return self.framework_transform(self.representation_transform(x)) | ||
|
||
|
||
class TargetTransform: | ||
class TargetTransform(Transform): | ||
pass | ||
|
||
|
||
class LabelTransform: | ||
class LabelTransform(Transform): | ||
pass |
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