From e76617c9a93c66982548aaebf6c136b4908ebcd1 Mon Sep 17 00:00:00 2001 From: dsh Date: Wed, 8 May 2024 11:39:54 +0100 Subject: [PATCH] Removed Python Code from C++ Content Example The Tensorflow node in the C++ Roadmap used Python code as examples, I have removed this. --- .../cpp/content/libraries/105-tensorflow.md | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) 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.