New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Problem with computing metrics #216
Comments
It is probably related because I have the same error when defining a custom loss: (and replacing model by the following code) class BCE(eg.Loss):
def call(self, y_true, y_pred):
return -jnp.mean(y_true*jnp.log(y_pred+1e-7) + (1-y_true)*jnp.log(1-y_pred+1e-7))
model = eg.Model(
module=eCNN(),
loss=[
BCE(),
],
# metrics=eg.metrics.MeanSquareError(),
optimizer=optax.rmsprop(1e-3),
) |
Hey @organic-chemistry! I think the use of Losses and Metrics within Elegy needs to be properly documented. Elegy uses a simple name-based dependency injection system, meaning there is a fix set of names you can use for the arguments of the Lines 220 to 233 in 546c504
where On the other hand, to fix your BTW: unless its for pedagogical reason, you can use |
Ok, thank you indeed it worked. |
@organic-chemistry thanks for the report! Recent refactor broke a lot of the documentation, I'll put an issue to remove old links. Some of this now lives in Treex and should be documented there. Sorry for the confusion 😅 |
Ok. Do you mean that you are going to stop working on elegy, and that the 'new' version is Treex ? |
Oh no, sorry for the confusion. Treex is a low level library that implements Modules, Losses and Metrics, while Elegy is a high-level API. Elegy existed before Treex, but once Treex was stable it made sense to refactor Elegy on top of Treex as it simplified the codebase.
Thanks ☺ |
Describe the bug
Hi, when I am using the fit function I have an error message that the update function is not provided with y_true and y_pred.
It seems to be coming from the metrics of the model, because if I comment the metrics line I have no error
Minimal code to reproduce
Small snippet that contains a minimal amount of code.
Library Info
Please provide os info and elegy version.
The text was updated successfully, but these errors were encountered: