Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A minimal TensorFlow example showing linear regression training on sample data.
import tensorflow as tf
import numpy as np
# Sample data
x_train = np.array([1, 2, 3, 4], dtype=float)
y_train = np.array([2, 4, 6, 8], dtype=float)
# Define a simple linear model
model = tf.keras.Sequential([tf.keras.layers.Dense(units=1, input_shape=[1])])
model.compile(optimizer='sgd', loss='mean_squared_error')
# Train the model
model.fit(x_train, y_train, epochs=500)
# Predict
y_pred = model.predict([10.0])
print("Prediction for 10:", y_pred)TensorFlow is an open-source, end-to-end platform for machine learning developed by Google. It provides comprehensive tools, libraries, and community resources for building and deploying ML models across different environments.
Origin & Creator
TensorFlow was created by the Google Brain team and released in 2015 to provide a flexible, scalable platform for machine learning.
Industrial Note
TensorFlow is widely adopted in industry and academia for scalable ML solutions, serving AI applications in computer vision, NLP, recommendation systems, and robotics.