Skip to content
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

Review Machine Learning tutorials #1626

Open
3 tasks done
DerekMelchin opened this issue Feb 22, 2024 · 4 comments
Open
3 tasks done

Review Machine Learning tutorials #1626

DerekMelchin opened this issue Feb 22, 2024 · 4 comments

Comments

@DerekMelchin
Copy link
Collaborator

Expected Behavior

The ML tutorials here provide educational material on how to use all three learning paradigms: supervised, unsupervised, and reinforcement learning. Each example is unique and informative.

Actual Behavior

Most of the examples solve the same problem, but just use a different library to do so. The text is also largely duplicated.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
@AlexCatarino
Copy link
Member

Before we review the tutorials to add more example, we need to review those we have.
Because of Tensorflow upgrade, Keras was broken (fixed by 8ee3fcb), but Tensorflow is still broken. For example, we cannot use

tf.reset_default_graph()
sess = tf.Session()

We could use it with compat.v1

tf.compat.v1.reset_default_graph()
sess = tf.compat.v1.Session()

but we shouldn't rely on Tensorflow backward compatibility since this is an example for the community.

Additionally, let's add a link to a backtest with the notebook to avoid copy and paste the code snippets. The notebook should include the page text.

@LouisSzeto LouisSzeto removed their assignment Apr 9, 2024
@DerekMelchin
Copy link
Collaborator Author

DerekMelchin commented Apr 12, 2024

Some issues I found with the new TF tutorials:

  • data isn't defined
  • The code in Prepare Data looks like it's calculating n-day returns, but the image below that code block is just showing close prices
  • The example notebook throws errors

Might be other errors too, please review it.

The TF tutorial should include a Lambda layer so that we can demonstrate how to fix the "name 'tf' is not defined" error when saving and loading from the Object Store. To avoid the error, instead of passing a lambda to the Lambda constructor, you need to pass a function. The function definition needs to have the @register_keras_serializable() decorator.
Refer to https://stackoverflow.com/questions/54347963/tf-is-not-defined-on-load-model-using-lambda

The TF tutorial should use Dense and Sequential, not dense and sequential

@LouisSzeto
Copy link
Collaborator

Since we are not using .h5 saving mode anymore, we don't need the Lambda logic.

@DerekMelchin
Copy link
Collaborator Author

The Aesera tutorial defines a self.train method, overriding the built-in self.train.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants