Access to all dimensional output #1040
Unanswered
zyc123456zzz
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Quick comment: I would put For multi-dimensional data, the right way is to use a TemplateExpressionSpec, and put each of your four features into spec = TemplateExpressionSpec(
expressions=["f1", "f2", "f3", "shared"],
variable_names=["x1", "x2", "x3", "y1", "y2", "y3"],
combine="""
v = shared(x1, x2, x3)
y1_predicted = v + f1(x1, x2, x3)
y2_predicted = v + f2(x1, x2, x3)
y3_predicted = v + f3(x1, x2, x3)
residuals = (
abs2(y1 - y1_predicted) +
abs2(y2 - y2_predicted) +
abs2(y3 - y3_predicted)
)
residuals
"""
) And you would just pass |
Beta Was this translation helpful? Give feedback.
0 replies
-
@zyc123456zzz I have now added an example to the docs! https://ai.damtp.cam.ac.uk/pysr/examples/#13-vector-valued-expressions - check it out |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Miles,
Sorry to bother you. I struggled with the customized loss_func, but I am not sure why I can not access the full prediction results in the loss function.
Basically, for the training dataset: input data shape is (7000, 14), output data shape is (7000, 4). Then I want to do a classification task. The output data is like: [0,0,1,0]. I want to customize my own loss function, it is basically calculating the L2 distance.
loss function
However, I find that the prediction data and dataset.y here are all shape (7000). Here I want to fully access all the input data whose shape should be (7000, 4).
I am not sure how to access the whole training data instead of one dimensional data. Hope to get your response!
Beta Was this translation helpful? Give feedback.
All reactions