Esempio n. 1
0
    def __init__(self, return_selection=False, **kwargs):
        # kwargs for the Layer class are handled automatically
        super().__init__(
            **{k: v
               for k, v in kwargs.items() if is_keras_kwarg(k)})
        self.supports_masking = True
        self.return_selection = return_selection

        # *_regularizer, *_constraint, *_initializer, activation, and use_bias
        # are dealt with automatically if passed to the constructor
        self.kwargs_keys = []
        for key in kwargs:
            if is_layer_kwarg(key):
                attr = kwargs[key]
                attr = deserialize_kwarg(key, attr)
                self.kwargs_keys.append(key)
                setattr(self, key, attr)

        # Signature of the SRC functions
        self.sel_signature = inspect.signature(self.select).parameters
        self.red_signature = inspect.signature(self.reduce).parameters
        self.con_signature = inspect.signature(self.connect).parameters
        self.i_red_signature = inspect.signature(self.reduce_index).parameters

        self._n_nodes = None
Esempio n. 2
0
 def __init__(self, **kwargs):
     super().__init__(**{k: v for k, v in kwargs.items() if is_keras_kwarg(k)})
     self.kwargs_keys = []
     for key in kwargs:
         if is_layer_kwarg(key):
             attr = kwargs[key]
             attr = deserialize_kwarg(key, attr)
             self.kwargs_keys.append(key)
             setattr(self, key, attr)
Esempio n. 3
0
 def __init__(self, **kwargs):
     super().__init__(**{k: v for k, v in kwargs.items() if is_keras_kwarg(k)})
     self.supports_masking = True
     self.kwargs_keys = []
     for key in kwargs:
         if is_layer_kwarg(key):
             attr = kwargs[key]
             attr = deserialize_kwarg(key, attr)
             self.kwargs_keys.append(key)
             setattr(self, key, attr)
     self.call = check_dtypes_decorator(self.call)
    def __init__(self, aggregate="sum", **kwargs):
        super().__init__(**{k: v for k, v in kwargs.items() if is_keras_kwarg(k)})
        self.kwargs_keys = []
        for key in kwargs:
            if is_layer_kwarg(key):
                attr = kwargs[key]
                attr = deserialize_kwarg(key, attr)
                self.kwargs_keys.append(key)
                setattr(self, key, attr)

        self.msg_signature = inspect.signature(self.message).parameters
        self.agg_signature = inspect.signature(self.aggregate).parameters
        self.upd_signature = inspect.signature(self.update).parameters
        self.agg = deserialize_scatter(aggregate)