Skip to content

Tools \ TensorFlow

TensorFlow
Tool's logo

An open-source platform for machine learning, specializing in training and deployment of deep neural networks.

Source code

Maturity : Maintained | Categories : Python Stack | License : | Producer : The TensorFlow Team


Overview

TensorFlow is an open-source platform for machine learning. It provides a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in machine learning, and developers easily build and deploy ML-powered applications.

TensorFlow supports multiple programming languages including Python, JavaScript, and Swift, and integrates well with other libraries like Keras.

Usage example

Installation

To install TensorFlow, you can use the following command in your terminal:

pip install tensorflow

Make sure you have a compatible version of Python installed (Python 3.6 to 3.9).

Basic Example

Here is a simple example that demonstrates how to create and train a basic neural network using TensorFlow:

import tensorflow as tf
from tensorflow.keras import layers, models

# Load and prepare the dataset
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

# Build a simple model
model = models.Sequential([
    layers.Flatten(input_shape=(28, 28)),
    layers.Dense(128, activation='relu'),
    layers.Dropout(0.2),
    layers.Dense(10)
])

# Compile the model
model.compile(optimizer='adam',
              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=['accuracy'])

# Train the model
model.fit(x_train, y_train, epochs=5)

# Evaluate the model
model.evaluate(x_test, y_test, verbose=2)

For more detailed tutorials and advanced usage, check out the TensorFlow Tutorials page.

Resources

Tutorials

There is no available tutorial for this tool.