Replies: 5 comments 11 replies
-
This feature is not yet available, though I would also like it! If you are very eager to have this feature (or anybody else reading this comment), I can help walk you through what needs to be done in the backend. I don't think it will be too bad (and Julia is pretty similar to Python in syntax), but it requires some care to make sure everything is compatible. If you want something quick and dirty, and don't have too many categories, I would recommend just passing in an additional feature e.g., if I just write down some random parameters But this is not going to be as clean or as accurate as a full implementation of a "TemplateParametricExpressionSpec". |
Beta Was this translation helpful? Give feedback.
-
Would like to echo support for parametric within template, particularly to support the flexibility of structure within parametric expression. That essentially gives you the power of a custom loss function. I have been doing my own workarounds for a problem with a variable that has 12 categories within template expression. |
Beta Was this translation helpful? Give feedback.
-
@gm89uk @Andrea-gm do you have any ideas for what would be the most intuitive API for something like this? How would you use the parameters inside the template expression? |
Beta Was this translation helpful? Give feedback.
-
I guess the main difference / difficulty between the approaches is a means to permit parameter optimisation within and also outside the functions of templateExpressions. |
Beta Was this translation helpful? Give feedback.
-
@gm89uk @Andrea-gm what about this API? structure = TemplateStructure{(:f, :g)}(
((; f, g), (x1, x2, x3, i1, i2), params) -> let
p1 = params[i1]
p2 = params[i2 + 15]
f(x1, x2) + g(x3, p2) + p1 * x1 * x3
end,
num_params=20
) Now, you would need to manually input the max number of categories in This The other part I like about this API is it is super super flexible. So you basically get access to this vector of parameters and can use them however you want. They'll be optimized like any other constant in the expression. I should also mention that whatever API we decide on is probably there permanently, which is why I'm trying to think very carefully about this. |
Beta Was this translation helpful? Give feedback.
-
Hello Miles,
I am trying to find an equation to describe the Bremsstrahlung X-rays collected within an energy-dispersive X-ray spectroscopy spectrum. I am using the following
TemplateExpressionSpec
:I was wondering if there was the possibility of making
k
parametric, such as the parameters withinParametricExpressionSpec
?k
is simply a scaling factor, and should be allowed to be different in every spectrum. The idea of a parametric expression would do the job, but I am not sure at the moment this can be integrated with aTemplateExpressionSpec
? Any suggestion on how to do this?Beta Was this translation helpful? Give feedback.
All reactions