layerai-archive / sdk

Metadata store for Production ML
https://layer.ai
Apache License 2.0
89 stars 7 forks source link

Adding features for tensorflow and tensorflow_decision_forests #199

Closed wuuthraad-x closed 2 years ago

wuuthraad-x commented 2 years ago

Summary

layer is a great way to track your models performance. I have been reading the documentation on layer and watching a few videos and have been unable to see anything on the use of tensorflow and tensorflow_decision_forests. Maybe there is and I have not seen it yet. I am not sure if layer is only for tabular data or you are planning on adding compatibility for deep learning algorithms in future

Motivation

I have really been enjoying my experience with layer and just wanted to be able to integrate it with the tensorflow models for computer vision as well as with tensorflow_decision_forests

volkangurel commented 2 years ago

Thanks for being a Layer user and for creating the issue @wuuthraad-x!

We have some examples using tensorflow here:

I don't think we support https://www.tensorflow.org/decision_forests yet, but we'll add support for it as soon as we can.

volkangurel commented 2 years ago

Here's a more detailed writeup of the image classification example: https://blog.layer.ai/mage-classification-with-convolutional-neural-networks-cnns/

volkangurel commented 2 years ago

And turns out we do support decision forests too! Here's a quick example:

# !pip install tensorflow_decision_forests layer
from layer.decorators import model
import layer
layer.login()
layer.init("trees-tf")

@model("tf-trees")
def train():
  import tensorflow_decision_forests as tfdf
  import pandas as pd

  train_df = layer.get_dataset("layer/titanic/datasets/passengers:3.6").to_pandas()
  train_df.dropna(inplace=True)
  train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="Survived")
  model = tfdf.keras.RandomForestModel()
  model.fit(train_ds)
  return model
train()
volkangurel commented 2 years ago

Please let me know if this answers your question @wuuthraad-x. I can mark this issue as closed if it does.

wuuthraad-x commented 2 years ago

Thanks for all the help and information @volkangurel .