Communitygithub.com

迁移学习适配器

构建此技能可自动化使用迁移学习技术对预训练机器学习模型进行适配。当用户请求微调模型、将预训练模型适配到新数据集或执行相关操作时触发。在检测到适当上下文时使用。根据技能目的触发相关短语。

迁移学习适配器 是什么?

此技能旨在简化和自动化迁移学习过程,将预训练模型(如 ResNet、BERT、GPT)适配到新的任务和数据集上。它通过分析用户请求、自动生成微调代码、实施验证和错误处理、提供性能指标并保存工件和文档来工作。主要优势在于显著节省时间和计算资源,避免从头训练模型。支持 TensorFlow 和 PyTorch 等主流框架,并可与数据加载和模型部署等插件集成。最佳实践包括数据预处理、超参数调优和正则化,以确保模型性能最优化。该技能特别适用于图像分类、情感分析等应用场景。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/adapting-transfer-learning-models

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

迁移学习适配器 是做什么的?

将预训练模型(ResNet、BERT、GPT)通过微调、层冻结和领域特定优化,适配到新任务和数据集。

概述

此技能简化了通过迁移学习适配预训练机器学习模型的过程。它能让你快速微调模型以完成特定任务,相比从头训练节省时间和资源。它处理模型适配、数据验证和性能优化的复杂性。

工作原理

  1. 分析需求:检查用户请求,以理解目标任务、数据集特征和期望的性能指标。
  2. 生成适配代码:使用合适的机器学习框架(例如 TensorFlow、PyTorch)创建 Python 代码,以在新数据集上微调预训练模型。这包括数据预处理步骤和必要的模型架构修改。
  3. 实现验证和错误处理:添加代码来验证数据、监控训练过程,并优雅地处理潜在错误。
  4. 提供性能指标:计算并报告关键性能指标(KPI),如准确率、精确率、召回率和 F1 分数,以评估模型的有效性。
  5. 保存工件和文档:保存适配后的模型、训练日志、性能指标,并自动生成描述适配过程和结果的文档。

何时使用此技能

当需要以下操作时,此技能会激活:

  • 为特定任务微调预训练模型。
  • 将预训练模型适配到新数据集。
  • 执行迁移学习以提高模型性能。
  • 为特定应用优化现有模型。

示例

示例 1:适配视觉模型用于图像分类

用户请求:"微调一个 ResNet50 模型,以对不同类型的鲜花图像进行分类。"

此技能将:

  1. 下载 ResNet50 模型并加载鲜花图像数据集。
  2. 生成代码以在鲜花数据集上微调模型,包括数据增强和优化技术。

示例 2:适配语言模型用于情感分析

用户请求:"适配一个 BERT 模型,以对客户评论进行情感分析。"

此技能将:

  1. 下载 BERT 模型并加载带有情感标签的客户评论数据集。
  2. 生成代码以在评论数据集上微调模型,包括分词、填充和注意力机制。

最佳实践

  • 数据预处理:确保数据经过适当预处理和格式化,以匹配预训练模型的输入要求。
  • 超参数调优:尝试不同的超参数(例如学习率、批大小)以优化模型性能。
  • 正则化:应用正则化技术(例如 Dropout、权重衰减)以防止过拟合。

集成

此技能可与其他插件集成,用于数据加载、模型评估和部署。例如,它可以与数据加载插件配合获取数据集,与模型部署插件配合将适配后的模型部署到服务基础设施。

先决条件

  • 适当的文件访问权限
  • 已安装所需的依赖项

说明

  1. 当满足触发条件时调用此技能
  2. 提供必要的上下文和参数
  3. 审查生成的输出
  4. 根据需要应用修改

输出

此技能生成与任务相关的结构化输出。

错误处理

  • 无效输入:提示纠正
  • 缺少依赖项:列出所需组件
  • 权限错误:建议修复步骤

资源

  • 项目文档
  • 相关技能和命令

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

相关技能