[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EW5TR86M9748MS809NSRVF":3,"skill-same:01M7EW5TR86M9748MS809NSRVF":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EW5TR86M9748MS809NSRVF","tensorflow-pro",null,"TensorFlow\u002FKeras guidance — model building, tf.data pipelines, training, SavedModel, TF Serving, and TFLite.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-tensorflow-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tensorflow-pro\ndescription: TensorFlow\u002FKeras guidance — model building, tf.data pipelines, training, SavedModel, TF Serving, and TFLite.\ncategory: development\n---\n\n## Overview\n\nTensorFlow (with Keras as its high-level API) is the production-oriented deep learning framework: strong serving story (TF Serving, TFLite, TF.js), `tf.data` pipelines, and broad deployment targets from servers to phones to browsers. Keras 3's multi-backend design (TensorFlow\u002FJAX\u002FPyTorch) makes model code portable in a way the ecosystem hasn't had before.\n\nThis skill covers the modern TF\u002FKeras workflow: building models with the Functional\u002FSequential APIs, efficient `tf.data` pipelines, training with `fit()` and custom loops, exporting SavedModels, and deploying via TF Serving and TFLite.\n\n## When to use\n\n- Building models with Keras (Functional or Sequential API).\n- Writing efficient `tf.data` input pipelines.\n- Training with `fit()` vs custom training loops.\n- Exporting SavedModel and serving with TF Serving.\n- Deploying to mobile\u002Fedge with TFLite.\n- Choosing between TensorFlow, PyTorch, and JAX.\n\n## Core concepts\n\n- **Keras APIs.** Sequential (linear stacks), Functional (DAGs — most real models), Subclassing (full control, less tooling support). Prefer Functional: it supports serialization, plotting, and multi-input\u002Foutput cleanly.\n- **Layers as the vocabulary.** Dense, Conv2D, LSTM\u002FGRU, Embedding, Attention\u002FMultiHeadAttention, normalization (BatchNorm\u002FLayerNorm), Dropout — compose from these; custom layers via subclassing with `build`\u002F`call`.\n- **`tf.data`.** The input pipeline: `Dataset.from_tensor_slices`\u002FTFRecord readers, `.map()` (parallel), `.batch()`, `.prefetch(tf.data.AUTOTUNE)`, `.cache()` — pipeline performance determines GPU utilization. TFRecord + prefetch is the production pattern.\n- **Training with `fit()`.** Compile (optimizer, loss, metrics) → `fit()` with callbacks (EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, TensorBoard). `fit()` handles distribution, callbacks, and validation correctly — use it unless custom loops are truly needed.\n- **Custom training loops.** `tf.GradientTape` for research-level control — forward pass in tape context, `tape.gradient`, `optimizer.apply_gradients`. More code, more responsibility (metrics, distribution) — reach for it only when `fit()` can't express the training.\n- **Losses\u002Fmetrics\u002Foptimizers.** `CategoricalCrossentropy`\u002F`SparseCategoricalCrossentropy` (know which your labels need), `BinaryCrossentropy`; Adam\u002FAdamW; metrics as running averages via `Metric` objects. Label-format\u002Floss mismatches are a perennial bug.\n- **Mixed precision.** `tf.keras.mixed_precision.set_global_policy('mixed_float16')` — one line, significant speedup on modern GPUs, with automatic loss scaling.\n- **Distribution strategies.** `MirroredStrategy` (multi-GPU single host), `MultiWorkerMirroredStrategy` (multi-host) — often just wrapping model creation and `fit()`; batch size and LR scaling as with any distributed training.\n- **Callbacks.** EarlyStopping (restore_best_weights=True), ModelCheckpoint (save best), TensorBoard, LearningRateScheduler — the training harness around `fit()`.\n- **SavedModel.** The serialization format: `model.save()` \u002F `tf.saved_model.save` — architecture + weights + signatures. The handoff format for TF Serving, TFLite conversion, and TF.js. Signatures define the serving API explicitly.\n- **TF Serving.** Production server for SavedModels: versioned model directories, gRPC\u002FREST APIs, model config for multi-model serving, canary versions. The boring-reliable serving path.\n- **TFLite.** Mobile\u002Fedge deployment: conversion with quantization (dynamic range, full integer, float16) trading size\u002Flatency for accuracy — always evaluate post-quantization metrics. The `TFLiteConverter` + representative dataset for full-integer quantization.\n- **TFX (awareness).** The end-to-end platform (ExampleGen → Transform → Trainer → Pusher) — full MLOps on TF; adopt when the pipeline complexity justifies it, not before.\n- **Keras 3 multi-backend.** Same Keras code on TensorFlow\u002FJAX\u002FPyTorch backends — write portable model code; backend-specific ops are the exception.\n\n## Practical workflow\n\n1. **Build with the Functional API.** Explicit inputs\u002Foutputs, serializable, plottable:\n   ```python\n   inputs = keras.Input(shape=(224, 224, 3))\n   x = keras.layers.Rescaling(1.0 \u002F 255)(inputs)\n   x = keras.layers.Conv2D(64, 3, activation=\"relu\")(x)\n   x = keras.layers.GlobalAveragePooling2D()(x)\n   outputs = keras.layers.Dense(10, activation=\"softmax\")(x)\n   model = keras.Model(inputs, outputs)\n   ```\n2. **Write the `tf.data` pipeline.** Parallel maps, batching, prefetching — and verify throughput before training:\n   ```python\n   ds = tf.data.Dataset.from_tensor_slices((paths, labels))\n   ds = ds.map(load_and_preprocess, num_parallel_calls=tf.data.AUTOTUNE)\n   ds = ds.shuffle(10000).batch(64).prefetch(tf.data.AUTOTUNE)\n   ```\n3. **Compile and fit with callbacks.** The right loss for your label format; early stopping with best-weight restore:\n   ```python\n   model.compile(optimizer=keras.optimizers.AdamW(1e-3),\n                 loss=\"sparse_categorical_crossentropy\", metrics=[\"accuracy\"])\n   model.fit(train_ds, validation_data=val_ds, epochs=50, callbacks=[\n       keras.callbacks.EarlyStopping(patience=5, restore_best_weights=True),\n       keras.callbacks.ModelCheckpoint(\"best.keras\", save_best_only=True),\n       keras.callbacks.TensorBoard(log_dir=\"logs\"),\n   ])\n   ```\n4. **Enable mixed precision.** One line near the top; verify no NaN regressions.\n5. **Scale distribution.** `MirroredStrategy` scope around model creation; scale batch\u002FLR; verify scaling efficiency.\n6. **Export SavedModel.** `model.export(\"saved_model\u002F1\")` with explicit signatures; test the exported artifact with the same inputs serving will send.\n7. **Serve or convert.** TF Serving for server deployment (versioned dirs, REST\u002FgRPC); TFLite converter with quantization for mobile\u002Fedge — always re-evaluate metrics after quantization.\n8. **Monitor training.** TensorBoard from run one: loss curves, LR, histograms; the smoke test (overfit one batch) applies here too.\n\n## Common pitfalls\n\n- **Wrong loss for label format** — `categorical` vs `sparse_categorical` mismatch; match loss to labels.\n- **Slow `tf.data`** — Python-level maps without parallelism\u002Fprefetch; AUTOTUNE + TFRecords.\n- **Custom loops when `fit()` suffices** — reimplementing distribution\u002Fcallbacks badly; default to `fit()`.\n- **Forgetting `restore_best_weights`** — EarlyStopping returning the overfit final epoch; always restore.\n- **No mixed precision** — leaving 2x performance on the table; one line to enable.\n- **Quantization without re-evaluation** — TFLite accuracy drops unnoticed; evaluate the converted model.\n- **Serving signature mismatches** — SavedModel signatures not matching client inputs; define and test signatures.\n- **Subclassed models breaking tooling** — serialization\u002Fplotting issues; prefer Functional API.\n- **BatchNorm in custom loops** — `training=True\u002FFalse` not passed; silent train\u002Finfer discrepancy.\n- **Shuffling without enough buffer** — poor randomization; adequate shuffle buffer or file-level shuffling.\n- **Ignoring TensorBoard** — training blind; log from the first run.\n- **TFX too early** — platform complexity for a single model; adopt with pipeline count.\n- **Version skew TF\u002FServing** — SavedModel ops unsupported by the serving version; align versions.\n","## Overview\n\nTensorFlow (with Keras as its high-level API) is the production-oriented deep learning framework: strong serving story (TF Serving, TFLite, TF.js), `tf.data` pipelines, and broad deployment targets from servers to phones to browsers. Keras 3's multi-backend design (TensorFlow\u002FJAX\u002FPyTorch) makes model code portable in a way the ecosystem hasn't had before.\n\nThis skill covers the modern TF\u002FKeras workflow: building models with the Functional\u002FSequential APIs, efficient `tf.data` pipelines, training with `fit()` and custom loops, exporting SavedModels, and deploying via TF Serving and TFLite.\n\n## When to use\n\n- Building models with Keras (Functional or Sequential API).\n- Writing efficient `tf.data` input pipelines.\n- Training with `fit()` vs custom training loops.\n- Exporting SavedModel and serving with TF Serving.\n- Deploying to mobile\u002Fedge with TFLite.\n- Choosing between TensorFlow, PyTorch, and JAX.\n\n## Core concepts\n\n- **Keras APIs.** Sequential (linear stacks), Functional (DAGs — most real models), Subclassing (full control, less tooling support). Prefer Functional: it supports serialization, plotting, and multi-input\u002Foutput cleanly.\n- **Layers as the vocabulary.** Dense, Conv2D, LSTM\u002FGRU, Embedding, Attention\u002FMultiHeadAttention, normalization (BatchNorm\u002FLayerNorm), Dropout — compose from these; custom layers via subclassing with `build`\u002F`call`.\n- **`tf.data`.** The input pipeline: `Dataset.from_tensor_slices`\u002FTFRecord readers, `.map()` (parallel), `.batch()`, `.prefetch(tf.data.AUTOTUNE)`, `.cache()` — pipeline performance determines GPU utilization. TFRecord + prefetch is the production pattern.\n- **Training with `fit()`.** Compile (optimizer, loss, metrics) → `fit()` with callbacks (EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, TensorBoard). `fit()` handles distribution, callbacks, and validation correctly — use it unless custom loops are truly needed.\n- **Custom training loops.** `tf.GradientTape` for research-level control — forward pass in tape context, `tape.gradient`, `optimizer.apply_gradients`. More code, more responsibility (metrics, distribution) — reach for it only when `fit()` can't express the training.\n- **Losses\u002Fmetrics\u002Foptimizers.** `CategoricalCrossentropy`\u002F`SparseCategoricalCrossentropy` (know which your labels need), `BinaryCrossentropy`; Adam\u002FAdamW; metrics as running averages via `Metric` objects. Label-format\u002Floss mismatches are a perennial bug.\n- **Mixed precision.** `tf.keras.mixed_precision.set_global_policy('mixed_float16')` — one line, significant speedup on modern GPUs, with automatic loss scaling.\n- **Distribution strategies.** `MirroredStrategy` (multi-GPU single host), `MultiWorkerMirroredStrategy` (multi-host) — often just wrapping model creation and `fit()`; batch size and LR scaling as with any distributed training.\n- **Callbacks.** EarlyStopping (restore_best_weights=True), ModelCheckpoint (save best), TensorBoard, LearningRateScheduler — the training harness around `fit()`.\n- **SavedModel.** The serialization format: `model.save()` \u002F `tf.saved_model.save` — architecture + weights + signatures. The handoff format for TF Serving, TFLite conversion, and TF.js. Signatures define the serving API explicitly.\n- **TF Serving.** Production server for SavedModels: versioned model directories, gRPC\u002FREST APIs, model config for multi-model serving, canary versions. The boring-reliable serving path.\n- **TFLite.** Mobile\u002Fedge deployment: conversion with quantization (dynamic range, full integer, float16) trading size\u002Flatency for accuracy — always evaluate post-quantization metrics. The `TFLiteConverter` + representative dataset for full-integer quantization.\n- **TFX (awareness).** The end-to-end platform (ExampleGen → Transform → Trainer → Pusher) — full MLOps on TF; adopt when the pipeline complexity justifies it, not before.\n- **Keras 3 multi-backend.** Same Keras code on TensorFlow\u002FJAX\u002FPyTorch backends — write portable model code; backend-specific ops are the exception.\n\n## Practical workflow\n\n1. **Build with the Functional API.** Explicit inputs\u002Foutputs, serializable, plottable:\n   ```python\n   inputs = keras.Input(shape=(224, 224, 3))\n   x = keras.layers.Rescaling(1.0 \u002F 255)(inputs)\n   x = keras.layers.Conv2D(64, 3, activation=\"relu\")(x)\n   x = keras.layers.GlobalAveragePooling2D()(x)\n   outputs = keras.layers.Dense(10, activation=\"softmax\")(x)\n   model = keras.Model(inputs, outputs)\n   ```\n2. **Write the `tf.data` pipeline.** Parallel maps, batching, prefetching — and verify throughput before training:\n   ```python\n   ds = tf.data.Dataset.from_tensor_slices((paths, labels))\n   ds = ds.map(load_and_preprocess, num_parallel_calls=tf.data.AUTOTUNE)\n   ds = ds.shuffle(10000).batch(64).prefetch(tf.data.AUTOTUNE)\n   ```\n3. **Compile and fit with callbacks.** The right loss for your label format; early stopping with best-weight restore:\n   ```python\n   model.compile(optimizer=keras.optimizers.AdamW(1e-3),\n                 loss=\"sparse_categorical_crossentropy\", metrics=[\"accuracy\"])\n   model.fit(train_ds, validation_data=val_ds, epochs=50, callbacks=[\n       keras.callbacks.EarlyStopping(patience=5, restore_best_weights=True),\n       keras.callbacks.ModelCheckpoint(\"best.keras\", save_best_only=True),\n       keras.callbacks.TensorBoard(log_dir=\"logs\"),\n   ])\n   ```\n4. **Enable mixed precision.** One line near the top; verify no NaN regressions.\n5. **Scale distribution.** `MirroredStrategy` scope around model creation; scale batch\u002FLR; verify scaling efficiency.\n6. **Export SavedModel.** `model.export(\"saved_model\u002F1\")` with explicit signatures; test the exported artifact with the same inputs serving will send.\n7. **Serve or convert.** TF Serving for server deployment (versioned dirs, REST\u002FgRPC); TFLite converter with quantization for mobile\u002Fedge — always re-evaluate metrics after quantization.\n8. **Monitor training.** TensorBoard from run one: loss curves, LR, histograms; the smoke test (overfit one batch) applies here too.\n\n## Common pitfalls\n\n- **Wrong loss for label format** — `categorical` vs `sparse_categorical` mismatch; match loss to labels.\n- **Slow `tf.data`** — Python-level maps without parallelism\u002Fprefetch; AUTOTUNE + TFRecords.\n- **Custom loops when `fit()` suffices** — reimplementing distribution\u002Fcallbacks badly; default to `fit()`.\n- **Forgetting `restore_best_weights`** — EarlyStopping returning the overfit final epoch; always restore.\n- **No mixed precision** — leaving 2x performance on the table; one line to enable.\n- **Quantization without re-evaluation** — TFLite accuracy drops unnoticed; evaluate the converted model.\n- **Serving signature mismatches** — SavedModel signatures not matching client inputs; define and test signatures.\n- **Subclassed models breaking tooling** — serialization\u002Fplotting issues; prefer Functional API.\n- **BatchNorm in custom loops** — `training=True\u002FFalse` not passed; silent train\u002Finfer discrepancy.\n- **Shuffling without enough buffer** — poor randomization; adequate shuffle buffer or file-level shuffling.\n- **Ignoring TensorBoard** — training blind; log from the first run.\n- **TFX too early** — platform complexity for a single model; adopt with pipeline count.\n- **Version skew TF\u002FServing** — SavedModel ops unsupported by the serving version; align versions.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-tensorflow-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill tensorflow-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill tensorflow-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill tensorflow-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-tensorflow-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]