I can’t seem to update the weights selectively. See below example where
x is a set of 3 weights and I want to only update, say the first component. But can’t seem to do so. Is there a way to do that?
x = param(rand(3)) loss() = sum((x .- float.(1:3)).^2) gs = Tracker.gradient(() -> loss(), params(x)) println(x) update!(x, -0.01gs[x]) # works println(x) println(x) update!(x, -0.01gs[x]) #doesn't work println(x)
I am trying to use Flux and it’s AD to do this https://www.autodeskresearch.com/publications/samestats