Hopefully, you found a new appreciation for Tensorflow.js with AWS Lambda and have new ideas as to how you can integrate this in your data science projects.Īs a result, you now should have no excuse to not show off your machine learning models in the real world. We have gone through the journey of deploying a simple machine learning model. !pip install -quiet tensorflowjs import tensorflow as tf from import Sequential from import Dense import tensorflowjs as tfjs # Set seed for reproducibility tf.t_seed(1) # Setup toy data X = tf.range(-5, 5, 0.1) Y = 2 * X + 5 # Create a simple model with 1 Linear unit in 1 Dense layer model = Sequential() ]) # Use stochastic gradient descent and mean squared error pile(optimizer='sgd', loss='mse') # Fit on the toy data model.fit(X, Y, epochs=100, batch_size=8, verbose=0) # Sanity check that the model has successfully trained slope, intercept = print("True Model: 2.0x + 5.0") print(f"Fit Model: Conclusion You can go directly to a preset Colaboratory notebook by clicking this link. I would suggest you use Google Colaboratory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |