54ad58d10cb8a0d96507e075cdc26730b9e86e7f,bindsnet/learning/__init__.py,MSTDPET,__init__,#MSTDPET#Any#Any#Any#,474

Before Change


                "This learning rule is not supported for this Connection type."
            )

        self.e_trace = torch.zeros(self.source.n, self.target.n)
        self.p_plus = torch.zeros(self.source.n)
        self.p_minus = torch.zeros(self.target.n)
        self.eligibility = torch.zeros(self.source.n, self.target.n)

    def _connection_update(self, **kwargs) -> None:
        // language=rst

After Change


    `(Florian 2007) <https://florian.io/papers/2007_Florian_Modulated_STDP.pdf>`_.
    

    def __init__(self, connection: AbstractConnection, nu: Optional[Union[float, Sequence[float]]] = None,
                 weight_decay: float = 0.0, **kwargs) -> None:
        // language=rst
        
        Constructor for ``MSTDPET`` learning rule.

        :param connection: An ``AbstractConnection`` object whose weights the ``MSTDPET`` learning rule will modify.
        :param nu: Single or pair of learning rates for pre- and post-synaptic events, respectively.
        :param weight_decay: Constant multiple to decay weights by on each iteration.

        Keyword arguments:

        :param float tc_plus: Time constant for pre-synaptic firing trace.
        :param float tc_minus: Time constant for post-synaptic firing trace.
        :param float tc_e_trace: Time constant for the eligibility trace.
        
        super().__init__(
            connection=connection, nu=nu, weight_decay=weight_decay, **kwargs
        )

        if isinstance(connection, (Connection, LocallyConnectedConnection)):
            self.update = self._connection_update
        elif isinstance(connection, Conv2dConnection):
            self.update = self._conv2d_connection_update
        else:
            raise NotImplementedError(
                "This learning rule is not supported for this Connection type."
            )

        self.tc_plus = torch.tensor(kwargs.get("tc_plus", 20.0))
        self.tc_minus = torch.tensor(kwargs.get("tc_minus", 20.0))
        self.tc_e_trace = torch.tensor(kwargs.get("tc_e_trace", 25.0))

    def _connection_update(self, **kwargs) -> None:
        // language=rst
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: BindsNET/bindsnet
Commit Name: 54ad58d10cb8a0d96507e075cdc26730b9e86e7f
Time: 2019-04-01
Author: danjsaund@gmail.com
File Name: bindsnet/learning/__init__.py
Class Name: MSTDPET
Method Name: __init__


Project Name: BindsNET/bindsnet
Commit Name: 54ad58d10cb8a0d96507e075cdc26730b9e86e7f
Time: 2019-04-01
Author: danjsaund@gmail.com
File Name: bindsnet/learning/__init__.py
Class Name: MSTDP
Method Name: __init__


Project Name: BindsNET/bindsnet
Commit Name: 54ad58d10cb8a0d96507e075cdc26730b9e86e7f
Time: 2019-04-01
Author: danjsaund@gmail.com
File Name: bindsnet/learning/__init__.py
Class Name: MSTDPET
Method Name: __init__


Project Name: kengz/SLM-Lab
Commit Name: 2381a50a70559340a0335288d648b4bb9a675588
Time: 2018-06-12
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/dqn.py
Class Name: HydraDQN
Method Name: train