How to use the cleverhans.model.Model.__init__ function in cleverhans

To help you get started, we’ve selected a few cleverhans examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tensorflow / cleverhans / tests_tf / test_attacks.py View on Github external
def __init__(self, scope='trivial', nb_classes=2, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
github tensorflow / cleverhans / tests_tf / test_attacks_tf.py View on Github external
def __init__(self, scope='simple', nb_classes=2, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
github tensorflow / cleverhans / tests_tf / test_attacks.py View on Github external
def __init__(self, scope='simple_spatial', nb_classes=2, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
github tensorflow / cleverhans / cleverhans / model_zoo / soft_nearest_neighbor_loss / SNNL_regularized_model.py View on Github external
def __init__(self, scope, nb_classes, nb_filters, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
    self.nb_filters = nb_filters

    self.fprop(self.make_input_placeholder())

    self.params = self.get_params()
github tensorflow / cleverhans / cleverhans_tutorials / tutorial_models.py View on Github external
def __init__(self, scope, nb_classes, nb_filters, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
    self.nb_filters = nb_filters

    # Do a dummy run of fprop to make sure the variables are created from
    # the start
    self.fprop(tf.placeholder(tf.float32, [128, 28, 28, 1]))
    # Put a reference to the params in self so that the params get pickled
    self.params = selZf.get_params()
github tensorflow / cleverhans / examples / mnist_blackbox_keras.py View on Github external
def __init__(self, scope, nb_classes, nb_filters=200, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
    self.nb_filters = nb_filters
github behzadanksu / rl-attack / model.py View on Github external
def __init__(self, img_in, nb_classes, scope, noisy=False, reuse=False, concat_softmax=False, **kwargs):
        del kwargs
        self.scope = scope
        self.num_actions = nb_classes
        self.noisy = noisy
        #self.reuse = reuse
        self.reuse = tf.AUTO_REUSE
        self.concat_softmax = concat_softmax
        #self.img_in = img_in
        Model.__init__(self, scope, nb_classes, locals())

        #self.fprop(tf.placeholder(tf.float32, [128, 28, 28, 1]))
        #self.fprop (img_in)
        #self.needs_dummy_fprop = True
        self.fprop (img_in)
        train_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.scope+"/convnet")
        train_vars += tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.scope+"/action_value")
        self.params = train_vars
        #self.params = self.get_params()
github tensorflow / cleverhans / cleverhans_tutorials / mnist_blackbox.py View on Github external
def __init__(self, scope, nb_classes, nb_filters=200, **kwargs):
    del kwargs
    Model.__init__(self, scope, nb_classes, locals())
    self.nb_filters = nb_filters
github tensorflow / cleverhans / examples / madry_lab_challenges / mnist / madry_mnist_model.py View on Github external
def __init__(self, nb_classes=10):
    # NOTE: for compatibility with Madry Lab downloadable checkpoints,
    # we cannot use scopes, give these variables names, etc.
    self.W_conv1 = self._weight_variable([5, 5, 1, 32])
    self.b_conv1 = self._bias_variable([32])
    self.W_conv2 = self._weight_variable([5, 5, 32, 64])
    self.b_conv2 = self._bias_variable([64])
    self.W_fc1 = self._weight_variable([7 * 7 * 64, 1024])
    self.b_fc1 = self._bias_variable([1024])
    self.W_fc2 = self._weight_variable([1024, nb_classes])
    self.b_fc2 = self._bias_variable([nb_classes])
    Model.__init__(self, '', nb_classes, {})