Skip to content

Class specifications

William F. Broderick edited this page Dec 13, 2019 · 2 revisions
  • both Models and Synthesis expect 4d (batch, channel, height width) tensors as inputs

    • we have a helper function to get images into this form
  • Models return tensors (3, 4, or 5d) or dictionaries of such tensors (only when multiscale)

    • 3d: batch, channel, info
    • 4d: batch, channel, height, width
    • 5d: batch, channel, time, height width
  • we need a helper function that takes any of these and converts it to a 1d tensor (and will be called in the analyze method)

  • Synthesis.synthesize() returns matched_image, matched_representation, where matched_image is the synthesized image (and has same name as class, e.g., metamer), same shape as the input, and matched_representation, which is the same shape/format as what model returns (NOT the flattened version).

    • for storing progress over time, these are the two to store
    • default should be to not store progress, but every Synthesis object should be able to

Want synthesis methods to have their attributes and methods be as similar as possible (not all need to have every one, but if they have analogous ones, they should certainly have the same names):

  • all: __init__, synthesize, analyze, save, load, to, flattening function mentioned above
  • Metamer:
    • methods: representation_error, normalized_mse, plot_representation_error, plot_metamer_status, animate
    • attributes: model, matched_image, target_image, saved_image, saved_image_gradient, target_representation, matched_representation, saved_representation, target_representation_gradient, seed, loss, learning_rate, gradient (norm of gradient), optimizer, scheduler, scales, scales_loss, scales_timing. and then most of the parameters as well.
Clone this wiki locally