diff --git a/src/data/roadmaps/cpp/content/libraries/105-tensorflow.md b/src/data/roadmaps/cpp/content/libraries/105-tensorflow.md index 8fd4cef8f..de769e31c 100644 --- a/src/data/roadmaps/cpp/content/libraries/105-tensorflow.md +++ b/src/data/roadmaps/cpp/content/libraries/105-tensorflow.md @@ -2,52 +2,4 @@ TensorFlow is an open-source machine learning library developed by researchers and engineers from the Google Brain team. It is designed for building, training, and deploying deep learning models. TensorFlow provides a set of tools for ML, deep learning, and numerical computation using data flow graphs. TensorFlow can process computations on GPUs and TPUs, which speed up training time and ensures efficient model deployment. -## Installation - -You can install TensorFlow using the Python package manager pip: - -```bash -pip install tensorflow -``` - -## Basic usage - -Here's a simple example of how to create and train a neural network with TensorFlow: - -```python -import tensorflow as tf -from tensorflow import keras - -# Load dataset -mnist = keras.datasets.mnist -(train_images, train_labels), (test_images, test_labels) = mnist.load_data() - -# Preprocess data -train_images = train_images / 255.0 -test_images = test_images / 255.0 - -# Define model -model = keras.Sequential([ - keras.layers.Flatten(input_shape=(28, 28)), - keras.layers.Dense(128, activation='relu'), - keras.layers.Dense(10, activation='softmax') -]) - -# Compile model -model.compile(optimizer='adam', - loss='sparse_categorical_crossentropy', - metrics=['accuracy']) - -# Train model -model.fit(train_images, train_labels, epochs=5) - -# Evaluate model -test_loss, test_acc = model.evaluate(test_images, test_labels, verbose=2) -print('\nTest accuracy:', test_acc) -``` - -This code loads the MNIST dataset, preprocesses the data, creates a simple neural network, compiles it, trains it, and evaluates its performance on the test set. - -For more advanced usage, TensorFlow offers several APIs like `tf.data`, `tf.keras`, and `tf.estimator` that enable flexible and efficient data input pipelines, composing and training complex neural network architectures, and managing large-scale distributed training. - -You can visit TensorFlow's official website (https://www.tensorflow.org/) and their GitHub repository (https://github.com/tensorflow/tensorflow) for more information, tutorials, and resources. \ No newline at end of file +You can visit TensorFlow's official website (https://www.tensorflow.org/) and their GitHub repository (https://github.com/tensorflow/tensorflow) for more information, tutorials, and resources.