Computer Vision News - September 2018
• objectives -- What do you want the model to visualize? • parameterization -- How do you describe the image? • transforms -- What transformations do you want your visualization to be robust to? Now, we want to see the optimization for several neurons -- in our case, two -- we can use the batch parameter with a value of 2 for this. We concatenate 2 objective functions in parallel, one for each batch -- the first batch will produce a visualization representing the first neuron and the second batch will produce a visualization representing the second neuron, as you can see in the code below. This technique will allow us to study a variety of interactions between these two neurons. We will study 5 of them: A 1-0 ratio (that is, the first neuron only), 0.75- 0.25 ratio, 0.5-0.5 ratio, 0.25-0.75 and 1-0. We will output the result of each of these 5 combinations: And the result is five images, one for each combination we set under the objective parameter. 19 Tool Computer Vision News Focus on… param_f = lambda: param.image(128, batch=2) objective = objectives.channel(*neuron1, batch=0) + objectives.channel(*neuron2, batch=1) _ = render.render_vis(model, objective, param_f) param_f = lambda: param.image(128, batch=5) objective = objectives.Objective.sum([ # neuron 1 objectives, orange row: 1.00 * objectives.channel(*neuron1, batch=0), 0.75 * objectives.channel(*neuron1, batch=1), 0.50 * objectives.channel(*neuron1, batch=2), 0.25 * objectives.channel(*neuron1, batch=3), 0.00 * objectives.channel(*neuron1, batch=4), # neuron 2 objectives, green row: 0.00 * objectives.channel(*neuron2, batch=0), 0.25 * objectives.channel(*neuron2, batch=1), 0.50 * objectives.channel(*neuron2, batch=2), 0.75 * objectives.channel(*neuron2, batch=3), 1.00 * objectives.channel(*neuron2, batch=4), ]) _ = render.render_vis(model, objective, param_f)
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=