Hi @YL0910, to me, it seems like what you are looking for is a variant of the PES learning rule. You can either use the PES learning rule as is, and apply a function on the error signal to convert a continuous valued signal into a discrete exist/not-exist signal, or you can write your own custom learning rule based on the PES learning rule. If you want to write your own learning rule, this forum post outlines how the learning rule logic is parsed by the Nengo simulator, and this forum post illustrates how to take an existing learning rule and make a custom version of it.