Skip to content

Commit

Permalink
Merge branch 'dev/main' into hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
adjavon committed Feb 15, 2024
2 parents 30ffdbb + d924076 commit d67df69
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing

- name: Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
5 changes: 3 additions & 2 deletions CONTRIBUTOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ This will also be run automatically when a PR is made to master and a codecov re

## Branching and PRs
- Users that have been added to the CellMap organization and the DaCapo project should be able to develop directly into the CellMap fork of DaCapo. Other users will need to create a fork.
- For a completely new feature, make a branch off of the `main` branch of CellMap's fork of DaCapo with a name describing the feature. If you are collaborating on a feature that already has a branch, you can branch off that feature branch.
- Currently, you should make your PRs into the main branch of CellMap's fork, or the feature branch you branched off of. PRs currently require one maintainer's approval before merging. Once the PR is merged, the feature branch should be deleted.
- For a completely new feature, make a branch off of the `dev/main` branch of CellMap's fork of DaCapo with a name describing the feature. If you are collaborating on a feature that already has a branch, you can branch off that feature branch.
- Currently, you should make your PRs into the `dev/main` branch of CellMap's fork, or the feature branch you branched off of. PRs currently require one maintainer's approval before merging. Once the PR is merged, the feature branch should be deleted.
- `dev/main` will be regularly merged to `main` when new features are fully implemented and all tests are passing.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def voxel_size(self) -> Coordinate:

@property
def roi(self) -> Roi:
return self.crop_roi
return self.crop_roi.intersect(self._source_array.roi)

@property
def writable(self) -> bool:
Expand Down
7 changes: 7 additions & 0 deletions dacapo/experiments/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ def __init__(
)
self.eval_activation = eval_activation

# UPDATE WEIGHT INITIALIZATION TO USE KAIMING
# TODO: put this somewhere better, there might be
# conv layers that aren't follwed by relus?
for _name, layer in self.named_modules():
if isinstance(layer, torch.nn.modules.conv._ConvNd):
torch.nn.init.kaiming_normal_(layer.weight, nonlinearity="relu")

def forward(self, x):
result = self.chain(x)
if not self.training and self.eval_activation is not None:
Expand Down
7 changes: 6 additions & 1 deletion dacapo/store/local_weights_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ def store_best(self, run: str, iteration: int, dataset: str, criterion: str):

if best_weights.exists():
best_weights.unlink()
best_weights.symlink_to(iteration_weights)
try:
best_weights.symlink_to(iteration_weights)
except FileExistsError:
best_weights.unlink()
best_weights.symlink_to(iteration_weights)

with best_weights_json.open("w") as f:
f.write(json.dumps({"iteration": iteration}))

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ dependencies = [
"cattrs",
"numpy-indexed",
"click",
"toml"]
"toml",
]

# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
Expand Down Expand Up @@ -238,4 +239,4 @@ ignore = [
".pre-commit-config.yaml",
".ruff_cache/**/*",
"tests/**/*",
]
]

0 comments on commit d67df69

Please sign in to comment.