Skip to content
Snippets Groups Projects
Commit 1d8821ef authored by s.islam's avatar s.islam
Browse files

Adding normalization to the validation step.

parent 36352829
No related branches found
No related tags found
No related merge requests found
......@@ -122,12 +122,12 @@ class TestDataModule(pl.LightningDataModule):
# Load the pyramid/00 per file
#For JSC Training.
pli_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/pli/NTransmittance'
cyto_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/stained'
#pli_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/pli/NTransmittance'
#cyto_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/stained'
#For Local Machine Training.
#pli_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/pli/NTransmittance'
#cyto_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/stained'
pli_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/pli/NTransmittance'
cyto_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/stained'
pli_files_list = [file for file in os.listdir(pli_path) if
file.endswith(('.h5', '.hdf', '.h4', '.hdf4', '.he2', '.hdf5', '.he5'))]
......
......@@ -52,6 +52,9 @@ class TestModule(pl.LightningModule):
cyto_imag_generated = self.forward(batch['pli_image'])
loss = self.loss_f(cyto_imag_generated, batch['cyto_image'])
self.log("val_loss", loss)
batch['pli_image'] = batch['pli_image'] + 0.5
batch['cyto_image'] = batch['cyto_image'] + 0.5
cyto_imag_generated = cyto_imag_generated +0.5
if batch_idx == 0:
grid = make_grid([batch['pli_image'][0], batch['cyto_image'][0], cyto_imag_generated[0]])
self.logger.experiment.add_image('Grid_images', grid, self.current_epoch, dataformats="CHW")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment