Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
saliency_method: string indicating saliency map type to generate.
Returns:
a saliency map and a smoothed saliency map.
Raises:
ValueError: if the saliency_method string does not match any included method
"""
if saliency_method == 'integrated_gradients':
integrated_placeholder = saliency.IntegratedGradients(graph, sess, y, image)
return integrated_placeholder
elif saliency_method == 'gradient':
gradient_placeholder = saliency.GradientSaliency(graph, sess, y, image)
return gradient_placeholder
elif saliency_method == 'guided_backprop':
gb_placeholder = saliency.GuidedBackprop(graph, sess, y, image)
return gb_placeholder
else:
raise ValueError('No saliency method method matched. Verification of'
'input needed')