Pass empty parameter to LearningRuleType

Is there any way of passing an empty parameter to a LearningRuleType? This would be useful, for example, if trying to run a model in a script taking command-line parameters. If no command-line parameter were specified (for ex. the PES learning rate) I would like the learning rule to use the default for its parameter:

NumberParam(“learning_rate”, low=0, readonly=True, default=1e-4)

I would then be able to instantiate the object in my script in a way similar to this:

conn.learning_rule_type = PES(learning_rate=empty())

None does not work with non-optional parameters and DefaultParameterType also is not accepted.

Most (if not all) Nengo objects can be instantiated with default values using the Default class from nengo.params. Here’s some example code specific to your question:

from nengo.params import Default

conn.learning_rule_type = PES(learning_rate=Default)