A comprehensive, production-grade learning repository dedicated to mastering TensorFlow foundations, Convolutional Neural Networks (CNNs), and Transfer Learning. This project is built using modern developer workflows, including Keras 3 API standards, explicit input handling, and the uv package manager for robust virtual environment isolation.
Cap.8 TensorFlow/
├── .assets/ # Persistent storage for artifacts (git-ignored)
│ ├── images/ # Training curves and evaluation snapshots
│ └── saved_models/ # Exported computational brains (.keras format)
├── .vscode/
│ └── settings.json # Pylance static analysis & environment fallback routes
├── Proiect_Final_TensorFlow/
│ ├── train_project.py # End-to-end multi-layer CNN training pipeline
│ └── predict.py # Inference and real-world image processing script
├── Sesiunea_36_TensorFlow_Fundamente/
│ └── fundamente.py # Multi-Layer Perceptron (MLP) blueprint & Tensors
├── Sesiunea_37_CNN/
│ └── cnn_mnist.py # Spatial feature extraction on matrix datasets
├── Sesiunea_38_Transfer_Learning/
│ └── transfer_learning.py # MobileNetV2 architecture freezing & customization
├── FLOW_INVATARE.md # Comprehensive lifecycle of deep learning models
├── GLOSAR_TERMENI.md # Complete AI dictionary (Tensor through Overfitting)
├── pyproject.toml # Modern declarative metadata for the project
└── README.md # This technical documentation file
Instead of legacy tools like venv, pip-tools, or .env configuration files, this workspace is managed strictly via uv. This ensures:
- Blazing Fast Restores: Virtual environments are instantiated up to 100x faster using hardlinks.
- Deterministic Locking: Dependencies (
tensorflow,matplotlib,numpy) are strictly tracked insidepyproject.toml.
To prevent runtime warnings (UserWarning: Do not pass an input_shape...) and future-proof the codebase against depreciation, all models explicitly use the tf.keras.layers.Input(shape=...) layer as the root entry point of Sequential instances.
TensorFlow heavily relies on dynamic module loading, which breaks standard static analysis. This repository implements specific fallback paths inside .vscode/settings.json, mapping extraPaths to point directly to the local .venv site-packages. This removes misleading red squiggly import lines.
Models are exported utilizing the modern, zipped-archive .keras native format. This solves tracking discrepancies for custom layers, ensures higher security compared to legacy pickle-based configurations, and compresses binary weight distribution.
Make sure you are standing in the workspace root directory (Cap.8 TensorFlow/) before running commands.
Trains a robust Convolutional Neural Network on the Fashion-MNIST dataset (60,000 clothing matrices across 10 distinct classes). The script integrates a Dropout(0.3) layer to stabilize variance and mitigate validation overfitting.
uv run Proiect_Final_TensorFlow/train_project.py- Expected Output: Execution log tracks 5 training epochs. It will generate a performance chart at
.assets/images/curba_invatare.pngand serialize the neural brain at.assets/saved_models/model_fashion.keras. - Benchmark Target: Evaluates with a test dataset accuracy threshold exceeding 90%.
Simulates production deployment by consuming the serialized network model to perform structural image classification.
uv run Proiect_Final_TensorFlow/predict.py- Fallback Mode: If no hardware or local files are found, the script generates an automatic digital noise matrix (
np.random.rand) to prevent fatal script crashes. - Real Image Validation:
- Save any
.jpgor.pngpicture of a piece of clothing (e.g., a shoe, bag, or shirt). - Rename it to
proba.jpg. - Place it inside the
.assets/images/directory. - Re-run the script. It will automatically load the file, downscale it to a
28x28single-channel grayscale structure, and predict the exact article class with its mathematical probability!
- Save any
GLOSAR_TERMENI.md: Explains all mathematical concepts (ReLU, Softmax, Categorical Crossentropy, Optimizer parameters) used in the code.FLOW_INVATARE.md: Outlines the standard engineering workflow from data raw pre-processing up to model inference.