-
Notifications
You must be signed in to change notification settings - Fork 2
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
Enh/pl 1.x #34
Open
ajtritt
wants to merge
14
commits into
master
Choose a base branch
from
enh/pl_1.x
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Enh/pl 1.x #34
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
238af28
adapt to work with PL 1.x
ajtritt 27bb2e5
Expand $CSCRATCH env variable on cori
rly 785a61d
Add architecture attribute to SlurmJob
rly aa6541a
Update set architecture on SlurmJob
rly d068cbf
Update run_job.py
rly d322f6e
Rename variable
rly 2d51ba0
Update run_job.py
rly 6006f28
Set conda env for cori jobs
rly 45d6da9
update PL commit
ajtritt 907d361
update summarize to work for classification results
ajtritt 98f445a
Merge branch 'master' into enh/pl_1.x
rly 5543c33
Merge branch 'fix/cori_paths' into enh/pl_1.x
rly 242a731
add support for cpu accelerator
rly ef5b994
Merge branch 'master' into enh/pl_1.x
ajtritt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
git+https://github.com/hdmf-dev/hdmf.git@0efea00ff1d10c4021c8145e917d92566f7edb4c | ||
seaborn==0.11.0 | ||
git+https://github.com/ajtritt/pytorch-lightning.git@99d2503373fe1b966cf7014c4ce7e7183766d48a | ||
torch==1.6.0 | ||
git+https://github.com/ajtritt/pytorch-lightning.git@fb30942d2c47a95531e063ed35a22f8fba25be12 |
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,3 +1,4 @@ | ||
import os | ||
import pytorch_lightning as pl | ||
import torch.nn.functional as F | ||
import torch | ||
|
@@ -94,6 +95,9 @@ def dataset_stats(argv=None): | |
|
||
|
||
def read_dataset(path): | ||
for root, dirs, files in os.walk("/mnt/bb/ajtritt/"): | ||
for filename in files: | ||
print(rank, '-', filename) | ||
hdmfio = get_hdf5io(path, 'r') | ||
difile = hdmfio.read() | ||
dataset = SeqDataset(difile) | ||
|
@@ -392,6 +396,49 @@ def get_loader(dataset, distances=False, **kwargs): | |
return DataLoader(dataset, collate_fn=collater, **kwargs) | ||
|
||
|
||
<<<<<<< HEAD | ||
class DIDataModule(pl.LightningDataModule): | ||
|
||
def __init__(self, hparams, inference=False): | ||
self.hparams = hparams | ||
self.inference = inference | ||
|
||
def train_dataloader(self): | ||
self._check_loaders() | ||
return self.loaders['train'] | ||
|
||
def val_dataloader(self): | ||
self._check_loaders() | ||
return self.loaders['validate'] | ||
|
||
def test_dataloader(self): | ||
self._check_loaders() | ||
return self.loaders['test'] | ||
|
||
|
||
|
||
def _check_loaders(self): | ||
""" | ||
Load dataset if it has not been loaded yet | ||
""" | ||
dataset, io = process_dataset(self.hparams, inference=self._inference) | ||
if self.hparams.load: | ||
dataset.load() | ||
|
||
kwargs = dict(random_state=self.hparams.seed, | ||
batch_size=self.hparams.batch_size, | ||
distances=self.hparams.manifold, | ||
downsample=self.hparams.downsample) | ||
kwargs.update(self.hparams.loader_kwargs) | ||
if self._inference: | ||
kwargs['distances'] = False | ||
kwargs.pop('num_workers', None) | ||
kwargs.pop('multiprocessing_context', None) | ||
tr, te, va = train_test_loaders(dataset, **kwargs) | ||
self.loaders = {'train': tr, 'test': te, 'validate': va} | ||
self.dataset = dataset | ||
|
||
======= | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line needs to be removed |
||
class DeepIndexDataModule(pl.LightningDataModule): | ||
|
||
def __init__(self, hparams, inference=False): | ||
|
@@ -419,3 +466,4 @@ def val_dataloader(self): | |
|
||
def test_dataloader(self): | ||
return self.loaders['test'] | ||
>>>>>>> master |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be removed.