TensorFlow Patterns

Provide TensorFlow and Keras patterns for model building and deployment.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/HermeticOrmus/LibreMLOps-Claude-Code --skill tensorflow-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TensorFlow Patterns
Source: https://github.com/HermeticOrmus/LibreMLOps-Claude-Code/tree/main/plugins/tensorflow-patterns/skills/tensorflow-patterns
Command: npx skills add https://github.com/HermeticOrmus/LibreMLOps-Claude-Code --skill tensorflow-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert patterns and best practices for building, optimizing, and deploying machine learning models using TensorFlow and Keras, addressing common challenges in model architecture, data pipelines, and deployment.

Core Features & Use Cases

  • Keras Functional API: Demonstrates building complex, multi-input models with proper layer usage.
  • Optimized tf.data Pipelines: Illustrates the correct order of operations for efficient data loading and preprocessing.
  • Custom Layers & Losses: Shows how to implement custom components like attention layers and focal loss.
  • SavedModel Export: Guides on exporting models with serving signatures for TensorFlow Serving.
  • TFLite Quantization: Explains post-training quantization for model size reduction and performance improvement.
  • Use Case: Develop a robust image classification model by leveraging the Keras Functional API, optimizing its data pipeline with tf.data, and then quantizing it to TFLite for efficient mobile deployment.

Quick Start

Show me how to build a Keras functional API model for multi-input classification.

Frequently Asked Questions about TensorFlow Patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a multi-input Keras model using the functional API?

Build a multi-input Keras model using the functional API by defining layer tensors independently and merging them via concatenation layers. This approach allows complex architecture construction that the Sequential API cannot handle.

What is the correct order of operations for optimized tf.data pipelines?

Optimized tf.data pipelines apply operations in a specific sequence: read, map, cache, shuffle, batch, and prefetch. This ordering minimizes CPU bottlenecks and overlaps data preprocessing with model training.

How do I export a TensorFlow SavedModel with serving signatures for TensorFlow Serving?

Export a TensorFlow SavedModel with serving signatures by defining a concrete prediction function and attaching it using tf.saved_model.save. This creates a standardized deployment package for TensorFlow Serving.

How do I implement custom layers and losses like focal loss in TensorFlow?

Implement custom layers and losses in TensorFlow by subclassing tf.keras.layers.Layer or tf.keras.losses.Loss. This provides the flexibility to define custom forward passes and loss calculations like focal loss for specific model objectives.

How do I apply TFLite post-training quantization to reduce model size?

Apply TFLite post-training quantization by converting a trained TensorFlow model using the TFLiteConverter with optimization flags. This reduces model size and improves inference speed for mobile deployment.

Can I use these TensorFlow patterns for efficient mobile deployment?

You can use these TensorFlow patterns for mobile deployment by combining optimized tf.data pipelines for training and TFLite post-training quantization for the final model. This workflow ensures efficient execution on edge devices.