This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
Added GAN parameter for logging generated images to Tensorboard #477
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.
Status
WORK IN PROGRESS
Description
The goal of this change is to add a new parameter to the GAN application in order to log 2D views of 3D images in Tensorboard. It adds a
tensorboard_n_fake_images
argument to the GAN section, with a default of zero. This is the number of images that will be logged to Tensorboard at each training logging step (tensorbard_every_n
), 3 views (sagittal, coronal and axial) for each image.This was already implemented in segmentation tasks, but not GAN. Some of the implementation decissions previously taken have affected the way this was implemented, so as to not break previous work: I've only added, not modified.
In particular the
max_out
parameter inniftynet.io.misc_io.image3
, and themax_outputs
parameter inniftynet.io.misc_io.image3_sagittal
,niftynet.io.misc_io.image3_axial
andniftynet.io.misc_io.image3_coronal
has made it a little difficult to implement. This has introduced some code repetition: as far as I know, it's not possible to pass this argument toOutputsCollector.add_to_collection
, so new functions without these arguments needed to be created.In my opinion, this parameter could be removed and just take a slice of the tensor to log before passing it in, like I've done in
GANApplication
, but I don't have the necessary knowledge about previous code to assess this well.Types of changes
Todos
Impacted Areas in Application
List general components of the application that this PR will affect:
niftynet.application.gan_application.GANApplication