Replace neurons type with custom neurons after training

I’m trying to replace ensemble’s neurons with custom neurons after each training step without changing the current weights in nengo or nengo_dl, would you please help me in this matter ?

Thank you in advance for your attention.

You should be able to do that with something like this approach:

with nengo.Network() as net:
    ... < build the network > ...

for i in range(n_epochs):
    with nengo_dl.Simulator(net) as sim:
        if i > 0:
            sim.load_params("my_params"), epochs=1)

    for ens in net.all_ensembles:
        ens.neuron_type = MyNeuronType(...)