Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset early stop counting #31

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,20 @@ information (protein ID) as a label to learn the localization patterns of protei
Recommended: create a new environment and install cytoself on the environment from pypi

(Optional) To run cytoself on GPUs, it is recommended to install pytorch GPU version before installing cytoself
following the [official instruction](https://pytorch.org/get-started/locally/).
following the [official instruction](https://pytorch.org/get-started/locally/). The way to install pytorch GPU may vary upon your OS and CUDA version.
```shell script
conda create -y -n cytoself python=3.9
conda activate cytoself
# (Optional: Install pytorch GPU following the official instruction)
pip install cytoself
```

### (For the developers) Install from this repository
Make sure you are in the root directory of the repository.

```bash
pip install -e .
```

### (For the developers) Install from this repository
Install development dependencies

```bash
pip install -r requirements/development.txt
pre-commit install
```


Expand Down Expand Up @@ -184,9 +179,10 @@ fig.show()

## Tested Environments

Rocky Linux 8.6, NVIDIA A100, CUDA 11.7 (GPU)
Rocky Linux 8.6, NVIDIA A100, CUDA 11.7 (GPU)<br/>
Ubuntu 20.04.3 LTS, NVIDIA 3090, CUDA 11.4 (GPU)<br/>
Ubuntu 22.04.3 LTS, NVIDIA 4090, CUDA 12.2 (GPU)

Ubuntu 20.04.3 LTS, NVIDIA 3090, CUDA 11.4 (GPU)

## Data Availability
The full data used in this work can be found here.
Expand Down
2 changes: 1 addition & 1 deletion cytoself/trainer/autoencoder/decoders/resnet2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(

for i in range(num_blocks):
if use_upsampling:
target_shape = tuple(np.ceil(output_shape[1:] / (2 ** (num_blocks - (i + 1)))).astype(int))
target_shape = tuple(np.ceil(output_shape[1:] / (2 ** (num_blocks - (i + 1)))).astype(int).tolist())
self.decoder[f'up{i + 1}'] = nn.Upsample(size=target_shape, mode=sampling_mode, align_corners=False)

self.decoder[f'resrep{i+1}'] = ResidualBlockRepeat(
Expand Down
1 change: 1 addition & 0 deletions cytoself/trainer/basetrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def fit(
self.best_model = deepcopy(self.model)
# Save the best model checkpoint
self.save_checkpoint()
count_early_stop = 0
else:
count_lr_no_improve += 1
count_early_stop += 1
Expand Down
Loading