Skip to content

Unable to evaluate a Lux model at a specific parameter set. #1380

@TorkelE

Description

@TorkelE

Say that I have a Lux model

using Lux
model = Lux.Chain(
    Lux.Dense(1 => 4, Lux.softplus),
    Lux.Dense(4 => 4, Lux.softplus),
    Lux.Dense(4 => 1, Lux.softplus)
)

Two questions:

  1. is there a way to learn how many parameters this model have? All function I apply returns various structured things which I cannot really understand what they contain.
  2. Lets say my model has 5 parameters and 1 input, how do I, given that I have these in normal vectors:
input = [1.0]
p_vals = [1.0, -2.0, 0.5, 5.0, -1.5]

get the output of my neural network for these parameter values and output?

I have spent the last couple of days trying to get something like this to work, but I really have not been able to. i have been trying to make a basic example where I can train a model using optimization (where I have a neural network and some other things I want to optimize), and then build from there. Unfortunatley I cannot get this to work. Doc pages I have been reading include
https://lux.csail.mit.edu/stable/introduction/
https://lux.csail.mit.edu/stable/tutorials/beginner/1_Basics
https://docs.sciml.ai/Optimization/stable/optimization_packages/optimization/#Train-NN-with-Sophia
https://lux.csail.mit.edu/stable/tutorials/beginner/5_OptimizationIntegration
https://lux.csail.mit.edu/stable/tutorials/beginner/2_PolynomialFitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions