Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

javierbg
Copy link
Contributor

@javierbg javierbg commented Jan 30, 2020

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 in niftynet.io.misc_io.image3, and the max_outputs parameter in niftynet.io.misc_io.image3_sagittal, niftynet.io.misc_io.image3_axial and niftynet.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 to OutputsCollector.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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Todos

  • Tests
  • Documentation

Impacted Areas in Application

List general components of the application that this PR will affect:

  • niftynet.application.gan_application.GANApplication

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant