I know it's possible to have a learning rate per layer (link). I also found how to dynamically change the learning rate (changing it in the middle of training dynamically without a scheduler) (link).
How can I create an optimizer that will have a dynamic learning rate per neuron? So that I could change the value of the learning rate for specific neurons during training
As an example, if my network is as follows:
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.fc1 = nn.Linear(3,5)
self.fc2 = nn.Linear(5,10)
self.fc3 = nn.Linear(10,1)
def forward(self, x):
x = torch.relu(self.fc1(x))
x = torch.relu(self.fc2(x))
x = torch.relu(self.fc3(x))
return x
There should be 5 learning rates for the first layer (one for each of the 5 neurons, where each neuron has 3 associated weights), 10 for the second layer, and 1 for the last one.