rstudio / keras3

R Interface to Keras
https://keras3.posit.co/
Other
833 stars 282 forks source link

Support for keras-tcn #1455

Open Steviey opened 4 months ago

Steviey commented 4 months ago

https://github.com/philipperemy/keras-tcn/issues/246

t-kalinowski commented 4 months ago

Hi, thanks for opening.

If you're looking for Temporal Fusion Transformers for timeseries in R+Keras: https://github.com/krzjoa/aeon

If there is a Keras layer in the Python community you want to use from R, like https://github.com/philipperemy/keras-tcn, you can do so like this:

# install the python package
reticulate::py_install("keras-tcn")

# import the python module: 
tcn <- reticulate::import("tcn")

# create the layer
layer <- tcn$TCN(...)

# use the layer() normally (e.g., in a Functional or Sequential Model)

Note, it seems the two tft implementations linked to have not yet been updated for Keras 3.