</>
Skip to content
AI lessons (34/37)

AI — TensorFlow

What is TensorFlow?

Open-source machine learning framework by Google.

Install

pip install tensorflow

Basic Model

import tensorflow as tf

# Create model
model = tf.keras.Sequential([
    tf.keras.layers.Dense(128, activation='relu'),
    tf.keras.layers.Dense(10, activation='softmax')
])

# Compile
model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

# Train
model.fit(X_train, y_train, epochs=10)

Layers

LayerDescription
DenseFully connected
Conv2DConvolutional
LSTMRecurrent
DropoutRegularization

Mini Practice

  1. Install TensorFlow
  2. Build simple model
  3. Train and evaluate
  4. Try different layers

Up Next

Continue with PyTorch — PyTorch basics.

Related Topics

Frequently Asked Questions about TensorFlow

What is TensorFlow in AI?

TensorFlow is a fundamental concept in AI. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn TensorFlow?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn TensorFlow.

Why is TensorFlow important in AI?

TensorFlow is essential for AI development. Understanding this concept will help you write better code and solve real-world problems more effectively.