Hi
Can you give us more details on your optimization problem? Depending on your criteria and constraints, it may be possible to solve with matrices.
Otherwise, you to use the optimizer you must do the following. Assuming x is your parameter you want to optimize, and F is the linear function, and y is the desired output. So argmin Loss(F(x) - y). x0 is your initial point.
You should build a “network” F which does the linear operations you suggest. Then
x = Variable (x0)
optimizer = Adam([x], lr=args.lr)
optimizer.zero_grad()
y_est = F.forward(x)
loss = criterion (y_est, y)
loss.backward()
optimizer.step()