-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
75b98a5
commit 3ea65eb
Showing
5 changed files
with
58 additions
and
5 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,31 @@ | ||
# TODO | ||
from .architecture import Architecture | ||
|
||
from funlib.geometry import Coordinate | ||
|
||
import torch | ||
|
||
|
||
class DummyArchitecture(Architecture): | ||
def __init__(self, architecture_config): | ||
super().__init__() | ||
|
||
self.channels_in = architecture_config.num_in_channels | ||
self.channels_out = architecture_config.num_out_channels | ||
|
||
self.conv = torch.nn.Conv3d(self.channels_in, self.channels_out, kernel_size=3) | ||
|
||
@property | ||
def input_shape(self): | ||
return Coordinate(40, 20, 20) | ||
|
||
@property | ||
def num_in_channels(self): | ||
return self.channels_in | ||
|
||
@property | ||
def num_out_channels(self): | ||
return self.channels_out | ||
|
||
def forward(self, x): | ||
return self.conv(x) |
22 changes: 22 additions & 0 deletions
22
dacapo/experiments/architectures/leibnetz_architecture_config.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,22 @@ | ||
# TODO | ||
import attr | ||
|
||
from .dummy_architecture import DummyArchitecture | ||
from .architecture_config import ArchitectureConfig | ||
|
||
from typing import Tuple | ||
|
||
|
||
@attr.s | ||
class DummyArchitectureConfig(ArchitectureConfig): | ||
"""This is just a dummy architecture config used for testing. None of the | ||
attributes have any particular meaning.""" | ||
|
||
architecture_type = DummyArchitecture | ||
|
||
num_in_channels: int = attr.ib(metadata={"help_text": "Dummy attribute."}) | ||
|
||
num_out_channels: int = attr.ib(metadata={"help_text": "Dummy attribute."}) | ||
|
||
def verify(self) -> Tuple[bool, str]: | ||
return False, "This is a DummyArchitectureConfig and is never valid" |
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