Basically, I have a Lux model like:
model = Lux.Chain(
Lux.Dense(1 => 4, Lux.softplus),
Lux.Dense(4 => 4, Lux.softplus),
Lux.Dense(4 => 4, Lux.softplus),
Lux.Dense(4 => 1, Lux.softplus)
)
and I like to generate a Lux model from it
model = Lux.Chain(
Lux.Dense(2 => 4, Lux.softplus), # Changed 1 to 2
Lux.Dense(4 => 4, Lux.softplus),
Lux.Dense(4 => 4, Lux.softplus),
Lux.Dense(4 => 1, Lux.softplus)
)
is there an easy way to do this?
I could of course declare it directly. However, I have a workflow for fitting functions for Lux models. Now, sometimes my functions are periodic, and I can encode this through some transfomration that reuqires to network to have two inputs. And here I need to detect it and generate the appropriate model. So Ideally I'd like to create a function like:
function make_input_2(model_1ins)
model_2ins = deepcopy(model_1ins)
model_2ins.later_1.in_dims = 2
return model_2ins
end
however, I am usure of the best way to do this.