@wentorai/research-plugins 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -22
- package/curated/analysis/README.md +82 -56
- package/curated/domains/README.md +225 -69
- package/curated/literature/README.md +115 -46
- package/curated/research/README.md +106 -58
- package/curated/tools/README.md +107 -87
- package/curated/writing/README.md +92 -45
- package/mcp-configs/academic-db/alphafold-mcp.json +20 -0
- package/mcp-configs/academic-db/brightspace-mcp.json +21 -0
- package/mcp-configs/academic-db/climatiq-mcp.json +20 -0
- package/mcp-configs/academic-db/gibs-mcp.json +20 -0
- package/mcp-configs/academic-db/gis-mcp-server.json +22 -0
- package/mcp-configs/academic-db/google-earth-engine-mcp.json +21 -0
- package/mcp-configs/academic-db/m4-clinical-mcp.json +21 -0
- package/mcp-configs/academic-db/medical-mcp.json +21 -0
- package/mcp-configs/academic-db/nexonco-mcp.json +20 -0
- package/mcp-configs/academic-db/omop-mcp.json +20 -0
- package/mcp-configs/academic-db/onekgpd-mcp.json +20 -0
- package/mcp-configs/academic-db/openedu-mcp.json +20 -0
- package/mcp-configs/academic-db/opengenes-mcp.json +20 -0
- package/mcp-configs/academic-db/openstax-mcp.json +21 -0
- package/mcp-configs/academic-db/openstreetmap-mcp.json +21 -0
- package/mcp-configs/academic-db/opentargets-mcp.json +21 -0
- package/mcp-configs/academic-db/pdb-mcp.json +21 -0
- package/mcp-configs/academic-db/smithsonian-mcp.json +20 -0
- package/mcp-configs/ai-platform/magi-researchers.json +21 -0
- package/mcp-configs/ai-platform/mcp-academic-researcher.json +22 -0
- package/mcp-configs/ai-platform/open-paper-machine.json +21 -0
- package/mcp-configs/ai-platform/paper-intelligence.json +21 -0
- package/mcp-configs/ai-platform/paper-reader.json +21 -0
- package/mcp-configs/ai-platform/paperdebugger.json +21 -0
- package/mcp-configs/browser/exa-mcp.json +20 -0
- package/mcp-configs/browser/mcp-searxng.json +21 -0
- package/mcp-configs/browser/mcp-webresearch.json +20 -0
- package/mcp-configs/cloud-docs/confluence-mcp.json +37 -0
- package/mcp-configs/cloud-docs/google-drive-mcp.json +35 -0
- package/mcp-configs/cloud-docs/notion-mcp.json +29 -0
- package/mcp-configs/communication/discord-mcp.json +29 -0
- package/mcp-configs/communication/discourse-mcp.json +21 -0
- package/mcp-configs/communication/slack-mcp.json +29 -0
- package/mcp-configs/communication/telegram-mcp.json +28 -0
- package/mcp-configs/data-platform/automl-stat-mcp.json +21 -0
- package/mcp-configs/data-platform/jefferson-stats-mcp.json +22 -0
- package/mcp-configs/data-platform/mcp-excel-server.json +21 -0
- package/mcp-configs/data-platform/mcp-stata.json +21 -0
- package/mcp-configs/data-platform/mcpstack-jupyter.json +21 -0
- package/mcp-configs/data-platform/ml-mcp.json +21 -0
- package/mcp-configs/data-platform/nasdaq-data-link-mcp.json +20 -0
- package/mcp-configs/data-platform/numpy-mcp.json +21 -0
- package/mcp-configs/database/neo4j-mcp.json +37 -0
- package/mcp-configs/database/postgres-mcp.json +28 -0
- package/mcp-configs/database/sqlite-mcp.json +29 -0
- package/mcp-configs/dev-platform/geogebra-mcp.json +21 -0
- package/mcp-configs/dev-platform/github-mcp.json +31 -0
- package/mcp-configs/dev-platform/gitlab-mcp.json +34 -0
- package/mcp-configs/dev-platform/latex-mcp-server.json +21 -0
- package/mcp-configs/dev-platform/manim-mcp.json +20 -0
- package/mcp-configs/dev-platform/mcp-echarts.json +20 -0
- package/mcp-configs/dev-platform/panel-viz-mcp.json +20 -0
- package/mcp-configs/dev-platform/paperbanana.json +20 -0
- package/mcp-configs/dev-platform/texflow-mcp.json +20 -0
- package/mcp-configs/dev-platform/texmcp.json +20 -0
- package/mcp-configs/dev-platform/typst-mcp.json +21 -0
- package/mcp-configs/dev-platform/vizro-mcp.json +20 -0
- package/mcp-configs/email/email-mcp.json +40 -0
- package/mcp-configs/email/gmail-mcp.json +37 -0
- package/mcp-configs/note-knowledge/local-faiss-mcp.json +21 -0
- package/mcp-configs/note-knowledge/mcp-memory-service.json +21 -0
- package/mcp-configs/note-knowledge/mcp-obsidian.json +23 -0
- package/mcp-configs/note-knowledge/mcp-ragdocs.json +20 -0
- package/mcp-configs/note-knowledge/mcp-summarizer.json +21 -0
- package/mcp-configs/note-knowledge/mediawiki-mcp.json +21 -0
- package/mcp-configs/note-knowledge/openzim-mcp.json +20 -0
- package/mcp-configs/note-knowledge/zettelkasten-mcp.json +21 -0
- package/mcp-configs/reference-mgr/academic-paper-mcp-http.json +20 -0
- package/mcp-configs/reference-mgr/academix.json +20 -0
- package/mcp-configs/reference-mgr/arxiv-research-mcp.json +21 -0
- package/mcp-configs/reference-mgr/google-scholar-abstract-mcp.json +19 -0
- package/mcp-configs/reference-mgr/google-scholar-mcp.json +20 -0
- package/mcp-configs/reference-mgr/mcp-paperswithcode.json +21 -0
- package/mcp-configs/reference-mgr/mcp-scholarly.json +20 -0
- package/mcp-configs/reference-mgr/mcp-simple-arxiv.json +20 -0
- package/mcp-configs/reference-mgr/mcp-simple-pubmed.json +20 -0
- package/mcp-configs/reference-mgr/mcp-zotero.json +21 -0
- package/mcp-configs/reference-mgr/mendeley-mcp.json +20 -0
- package/mcp-configs/reference-mgr/ncbi-mcp-server.json +22 -0
- package/mcp-configs/reference-mgr/onecite.json +21 -0
- package/mcp-configs/reference-mgr/paper-search-mcp.json +21 -0
- package/mcp-configs/reference-mgr/pubmed-search-mcp.json +21 -0
- package/mcp-configs/reference-mgr/scholar-mcp.json +21 -0
- package/mcp-configs/reference-mgr/scholar-multi-mcp.json +21 -0
- package/mcp-configs/reference-mgr/seerai.json +21 -0
- package/mcp-configs/reference-mgr/semantic-scholar-fastmcp.json +21 -0
- package/mcp-configs/reference-mgr/sourcelibrary.json +20 -0
- package/mcp-configs/registry.json +178 -149
- package/mcp-configs/repository/dataverse-mcp.json +33 -0
- package/mcp-configs/repository/huggingface-mcp.json +29 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
- package/skills/analysis/dataviz/algorithm-visualizer-guide/SKILL.md +259 -0
- package/skills/analysis/dataviz/bokeh-visualization-guide/SKILL.md +270 -0
- package/skills/analysis/dataviz/chart-image-generator/SKILL.md +229 -0
- package/skills/analysis/dataviz/citation-map-guide/SKILL.md +184 -0
- package/skills/analysis/dataviz/d3-visualization-guide/SKILL.md +281 -0
- package/skills/analysis/dataviz/data-visualization-principles/SKILL.md +171 -0
- package/skills/analysis/dataviz/echarts-visualization-guide/SKILL.md +250 -0
- package/skills/analysis/dataviz/metabase-analytics-guide/SKILL.md +242 -0
- package/skills/analysis/dataviz/plotly-interactive-guide/SKILL.md +266 -0
- package/skills/analysis/dataviz/redash-analytics-guide/SKILL.md +284 -0
- package/skills/analysis/econometrics/econml-causal-guide/SKILL.md +163 -0
- package/skills/analysis/econometrics/empirical-paper-analysis/SKILL.md +192 -0
- package/skills/analysis/econometrics/mostly-harmless-guide/SKILL.md +139 -0
- package/skills/analysis/econometrics/panel-data-analyst/SKILL.md +259 -0
- package/skills/analysis/econometrics/panel-data-regression-workflow/SKILL.md +267 -0
- package/skills/analysis/econometrics/python-causality-guide/SKILL.md +134 -0
- package/skills/analysis/econometrics/stata-accounting-guide/SKILL.md +269 -0
- package/skills/analysis/econometrics/stata-analyst-guide/SKILL.md +245 -0
- package/skills/analysis/econometrics/stata-reference-guide/SKILL.md +293 -0
- package/skills/analysis/statistics/data-anomaly-detection/SKILL.md +157 -0
- package/skills/analysis/statistics/general-statistics-guide/SKILL.md +226 -0
- package/skills/analysis/statistics/infiagent-benchmark-guide/SKILL.md +106 -0
- package/skills/analysis/statistics/ml-experiment-tracker/SKILL.md +212 -0
- package/skills/analysis/statistics/pywayne-statistics-guide/SKILL.md +192 -0
- package/skills/analysis/statistics/quantitative-methods-guide/SKILL.md +193 -0
- package/skills/analysis/statistics/senior-data-scientist-guide/SKILL.md +223 -0
- package/skills/analysis/wrangling/claude-data-analysis-guide/SKILL.md +100 -0
- package/skills/analysis/wrangling/csv-data-analyzer/SKILL.md +170 -0
- package/skills/analysis/wrangling/data-cleaning-pipeline/SKILL.md +266 -0
- package/skills/analysis/wrangling/data-cog-guide/SKILL.md +178 -0
- package/skills/analysis/wrangling/open-data-scientist-guide/SKILL.md +197 -0
- package/skills/analysis/wrangling/stata-data-cleaning/SKILL.md +276 -0
- package/skills/analysis/wrangling/streamline-analyst-guide/SKILL.md +119 -0
- package/skills/analysis/wrangling/survey-data-processing/SKILL.md +298 -0
- package/skills/domains/ai-ml/ai-agent-papers-guide/SKILL.md +146 -0
- package/skills/domains/ai-ml/ai-model-benchmarking/SKILL.md +209 -0
- package/skills/domains/ai-ml/annotated-dl-papers-guide/SKILL.md +159 -0
- package/skills/domains/ai-ml/anomaly-detection-papers-guide/SKILL.md +167 -0
- package/skills/domains/ai-ml/autonomous-agents-papers-guide/SKILL.md +178 -0
- package/skills/domains/ai-ml/dl-transformer-finetune/SKILL.md +239 -0
- package/skills/domains/ai-ml/domain-adaptation-papers-guide/SKILL.md +173 -0
- package/skills/domains/ai-ml/generative-ai-guide/SKILL.md +146 -0
- package/skills/domains/ai-ml/graph-learning-papers-guide/SKILL.md +125 -0
- package/skills/domains/ai-ml/huggingface-inference-guide/SKILL.md +196 -0
- package/skills/domains/ai-ml/keras-deep-learning/SKILL.md +210 -0
- package/skills/domains/ai-ml/kolmogorov-arnold-networks-guide/SKILL.md +185 -0
- package/skills/domains/ai-ml/llm-from-scratch-guide/SKILL.md +124 -0
- package/skills/domains/ai-ml/ml-pipeline-guide/SKILL.md +295 -0
- package/skills/domains/ai-ml/nlp-toolkit-guide/SKILL.md +247 -0
- package/skills/domains/ai-ml/npcpy-research-guide/SKILL.md +137 -0
- package/skills/domains/ai-ml/pytorch-guide/SKILL.md +281 -0
- package/skills/domains/ai-ml/pytorch-lightning-guide/SKILL.md +244 -0
- package/skills/domains/ai-ml/responsible-ai-guide/SKILL.md +126 -0
- package/skills/domains/ai-ml/tensorflow-guide/SKILL.md +241 -0
- package/skills/domains/ai-ml/vmas-simulator-guide/SKILL.md +129 -0
- package/skills/domains/biomedical/bioagents-guide/SKILL.md +308 -0
- package/skills/domains/biomedical/clawbio-guide/SKILL.md +167 -0
- package/skills/domains/biomedical/clinical-dialogue-agents-guide/SKILL.md +145 -0
- package/skills/domains/biomedical/ena-sequence-api/SKILL.md +175 -0
- package/skills/domains/biomedical/genomas-guide/SKILL.md +126 -0
- package/skills/domains/biomedical/genotex-benchmark-guide/SKILL.md +125 -0
- package/skills/domains/biomedical/med-researcher-guide/SKILL.md +161 -0
- package/skills/domains/biomedical/med-researcher-r1-guide/SKILL.md +146 -0
- package/skills/domains/biomedical/medgeclaw-guide/SKILL.md +345 -0
- package/skills/domains/biomedical/medical-imaging-guide/SKILL.md +305 -0
- package/skills/domains/biomedical/ncbi-blast-api/SKILL.md +195 -0
- package/skills/domains/biomedical/ncbi-datasets-api/SKILL.md +220 -0
- package/skills/domains/biomedical/quickgo-api/SKILL.md +181 -0
- package/skills/domains/business/architecture-design-guide/SKILL.md +279 -0
- package/skills/domains/business/innovation-management-guide/SKILL.md +257 -0
- package/skills/domains/business/operations-research-guide/SKILL.md +258 -0
- package/skills/domains/business/xpert-bi-guide/SKILL.md +84 -0
- package/skills/domains/chemistry/cactus-cheminformatics-guide/SKILL.md +89 -0
- package/skills/domains/chemistry/chemeagle-guide/SKILL.md +147 -0
- package/skills/domains/chemistry/chemgraph-agent-guide/SKILL.md +120 -0
- package/skills/domains/chemistry/molecular-dynamics-guide/SKILL.md +237 -0
- package/skills/domains/chemistry/pubchem-api-guide/SKILL.md +180 -0
- package/skills/domains/chemistry/spectroscopy-analysis-guide/SKILL.md +290 -0
- package/skills/domains/cs/ai-security-papers-guide/SKILL.md +103 -0
- package/skills/domains/cs/code-llm-papers-guide/SKILL.md +131 -0
- package/skills/domains/cs/distributed-systems-guide/SKILL.md +268 -0
- package/skills/domains/cs/formal-verification-guide/SKILL.md +298 -0
- package/skills/domains/cs/gaussian-splatting-papers-guide/SKILL.md +158 -0
- package/skills/domains/cs/llm-aiops-guide/SKILL.md +70 -0
- package/skills/domains/cs/software-heritage-api/SKILL.md +200 -0
- package/skills/domains/ecology/species-distribution-guide/SKILL.md +343 -0
- package/skills/domains/economics/imf-data-api-guide/SKILL.md +174 -0
- package/skills/domains/economics/nber-working-papers-api/SKILL.md +177 -0
- package/skills/domains/economics/post-labor-economics/SKILL.md +254 -0
- package/skills/domains/economics/pricing-psychology-guide/SKILL.md +273 -0
- package/skills/domains/economics/repec-economics-api/SKILL.md +188 -0
- package/skills/domains/economics/world-bank-data-guide/SKILL.md +179 -0
- package/skills/domains/education/academic-study-methods/SKILL.md +228 -0
- package/skills/domains/education/assessment-design-guide/SKILL.md +213 -0
- package/skills/domains/education/educational-research-methods/SKILL.md +179 -0
- package/skills/domains/education/edumcp-guide/SKILL.md +74 -0
- package/skills/domains/education/mooc-analytics-guide/SKILL.md +206 -0
- package/skills/domains/education/open-syllabus-api/SKILL.md +171 -0
- package/skills/domains/finance/akshare-finance-data/SKILL.md +207 -0
- package/skills/domains/finance/finsight-research-guide/SKILL.md +113 -0
- package/skills/domains/finance/options-analytics-agent-guide/SKILL.md +117 -0
- package/skills/domains/finance/portfolio-optimization-guide/SKILL.md +279 -0
- package/skills/domains/finance/risk-modeling-guide/SKILL.md +260 -0
- package/skills/domains/finance/stata-accounting-research/SKILL.md +372 -0
- package/skills/domains/geoscience/climate-modeling-guide/SKILL.md +215 -0
- package/skills/domains/geoscience/pangaea-data-api/SKILL.md +197 -0
- package/skills/domains/geoscience/satellite-remote-sensing/SKILL.md +193 -0
- package/skills/domains/geoscience/seismology-data-guide/SKILL.md +208 -0
- package/skills/domains/humanities/digital-humanities-methods/SKILL.md +232 -0
- package/skills/domains/humanities/ethical-philosophy-guide/SKILL.md +244 -0
- package/skills/domains/humanities/history-research-guide/SKILL.md +260 -0
- package/skills/domains/humanities/political-history-guide/SKILL.md +241 -0
- package/skills/domains/law/caselaw-access-api/SKILL.md +149 -0
- package/skills/domains/law/legal-agent-skills-guide/SKILL.md +132 -0
- package/skills/domains/law/legal-nlp-guide/SKILL.md +236 -0
- package/skills/domains/law/legal-research-methods/SKILL.md +190 -0
- package/skills/domains/law/opencontracts-guide/SKILL.md +168 -0
- package/skills/domains/law/patent-analysis-guide/SKILL.md +257 -0
- package/skills/domains/law/regulatory-compliance-guide/SKILL.md +267 -0
- package/skills/domains/math/lean-theorem-proving-guide/SKILL.md +140 -0
- package/skills/domains/math/symbolic-computation-guide/SKILL.md +263 -0
- package/skills/domains/math/topology-data-analysis/SKILL.md +305 -0
- package/skills/domains/pharma/clinical-trial-design-guide/SKILL.md +271 -0
- package/skills/domains/pharma/drug-target-interaction/SKILL.md +242 -0
- package/skills/domains/pharma/madd-drug-discovery-guide/SKILL.md +153 -0
- package/skills/domains/pharma/pharmacovigilance-guide/SKILL.md +216 -0
- package/skills/domains/physics/astrophysics-data-guide/SKILL.md +305 -0
- package/skills/domains/physics/particle-physics-guide/SKILL.md +287 -0
- package/skills/domains/social-science/ipums-microdata-api/SKILL.md +211 -0
- package/skills/domains/social-science/network-analysis-guide/SKILL.md +310 -0
- package/skills/domains/social-science/psychology-research-guide/SKILL.md +270 -0
- package/skills/domains/social-science/sociology-research-guide/SKILL.md +238 -0
- package/skills/domains/social-science/sociology-research-methods/SKILL.md +181 -0
- package/skills/literature/discovery/arxiv-paper-monitoring/SKILL.md +233 -0
- package/skills/literature/discovery/paper-recommendation-guide/SKILL.md +120 -0
- package/skills/literature/discovery/papers-we-love-guide/SKILL.md +169 -0
- package/skills/literature/discovery/semantic-paper-radar/SKILL.md +144 -0
- package/skills/literature/discovery/zotero-arxiv-daily-guide/SKILL.md +94 -0
- package/skills/literature/fulltext/bioc-pmc-api/SKILL.md +146 -0
- package/skills/literature/fulltext/core-api-guide/SKILL.md +144 -0
- package/skills/literature/fulltext/dataverse-api/SKILL.md +215 -0
- package/skills/literature/fulltext/hal-archive-api/SKILL.md +218 -0
- package/skills/literature/fulltext/institutional-repository-guide/SKILL.md +212 -0
- package/skills/literature/fulltext/open-access-mining-guide/SKILL.md +341 -0
- package/skills/literature/fulltext/osf-api/SKILL.md +212 -0
- package/skills/literature/fulltext/pmc-ftp-bulk-download/SKILL.md +182 -0
- package/skills/literature/fulltext/zotero-ai-butler-guide/SKILL.md +166 -0
- package/skills/literature/fulltext/zotero-scihub-guide/SKILL.md +168 -0
- package/skills/literature/metadata/academic-paper-summarizer/SKILL.md +101 -0
- package/skills/literature/metadata/bibliometrix-guide/SKILL.md +164 -0
- package/skills/literature/metadata/crossref-event-data-api/SKILL.md +183 -0
- package/skills/literature/metadata/doi-content-negotiation/SKILL.md +202 -0
- package/skills/literature/metadata/orkg-api/SKILL.md +153 -0
- package/skills/literature/metadata/plumx-metrics-api/SKILL.md +188 -0
- package/skills/literature/metadata/ror-organization-api/SKILL.md +208 -0
- package/skills/literature/metadata/sophosia-reference-guide/SKILL.md +110 -0
- package/skills/literature/metadata/viaf-authority-api/SKILL.md +209 -0
- package/skills/literature/metadata/wikidata-api-guide/SKILL.md +156 -0
- package/skills/literature/metadata/zoplicate-dedup-guide/SKILL.md +147 -0
- package/skills/literature/metadata/zotero-actions-tags-guide/SKILL.md +212 -0
- package/skills/literature/metadata/zotmoov-guide/SKILL.md +120 -0
- package/skills/literature/metadata/zutilo-guide/SKILL.md +140 -0
- package/skills/literature/search/arxiv-batch-reporting/SKILL.md +133 -0
- package/skills/literature/search/arxiv-cli-tools/SKILL.md +172 -0
- package/skills/literature/search/arxiv-osiris/SKILL.md +199 -0
- package/skills/literature/search/arxiv-paper-processor/SKILL.md +141 -0
- package/skills/literature/search/baidu-scholar-guide/SKILL.md +110 -0
- package/skills/literature/search/base-academic-search/SKILL.md +196 -0
- package/skills/literature/search/chatpaper-guide/SKILL.md +122 -0
- package/skills/literature/search/citeseerx-api/SKILL.md +183 -0
- package/skills/literature/search/deep-literature-search/SKILL.md +149 -0
- package/skills/literature/search/deepgit-search-guide/SKILL.md +147 -0
- package/skills/literature/search/eric-education-api/SKILL.md +199 -0
- package/skills/literature/search/findpapers-guide/SKILL.md +177 -0
- package/skills/literature/search/ieee-xplore-api/SKILL.md +177 -0
- package/skills/literature/search/lens-scholarly-api/SKILL.md +211 -0
- package/skills/literature/search/multi-database-literature-search/SKILL.md +198 -0
- package/skills/literature/search/open-library-api/SKILL.md +196 -0
- package/skills/literature/search/open-semantic-search-guide/SKILL.md +190 -0
- package/skills/literature/search/openaire-api/SKILL.md +141 -0
- package/skills/literature/search/paper-search-mcp-guide/SKILL.md +107 -0
- package/skills/literature/search/papers-chat-guide/SKILL.md +194 -0
- package/skills/literature/search/pasa-paper-search-guide/SKILL.md +138 -0
- package/skills/literature/search/plos-open-access-api/SKILL.md +203 -0
- package/skills/literature/search/scielo-api/SKILL.md +182 -0
- package/skills/literature/search/share-research-api/SKILL.md +129 -0
- package/skills/literature/search/worldcat-search-api/SKILL.md +224 -0
- package/skills/research/automation/ai-scientist-v2-guide/SKILL.md +284 -0
- package/skills/research/automation/aim-experiment-guide/SKILL.md +234 -0
- package/skills/research/automation/claude-academic-workflow-guide/SKILL.md +202 -0
- package/skills/research/automation/coexist-ai-guide/SKILL.md +149 -0
- package/skills/research/automation/datagen-research-guide/SKILL.md +131 -0
- package/skills/research/automation/foam-agent-guide/SKILL.md +203 -0
- package/skills/research/automation/kedro-pipeline-guide/SKILL.md +216 -0
- package/skills/research/automation/mle-agent-guide/SKILL.md +139 -0
- package/skills/research/automation/paper-to-agent-guide/SKILL.md +116 -0
- package/skills/research/automation/rd-agent-guide/SKILL.md +246 -0
- package/skills/research/automation/research-paper-orchestrator/SKILL.md +254 -0
- package/skills/research/deep-research/academic-deep-research/SKILL.md +190 -0
- package/skills/research/deep-research/auto-deep-research-guide/SKILL.md +141 -0
- package/skills/research/deep-research/cognitive-kernel-guide/SKILL.md +200 -0
- package/skills/research/deep-research/corvus-research-guide/SKILL.md +132 -0
- package/skills/research/deep-research/deep-research-pro/SKILL.md +213 -0
- package/skills/research/deep-research/deep-research-work/SKILL.md +204 -0
- package/skills/research/deep-research/deep-searcher-guide/SKILL.md +253 -0
- package/skills/research/deep-research/gpt-researcher-guide/SKILL.md +191 -0
- package/skills/research/deep-research/in-depth-research-guide/SKILL.md +205 -0
- package/skills/research/deep-research/khoj-research-guide/SKILL.md +200 -0
- package/skills/research/deep-research/kosmos-scientist-guide/SKILL.md +185 -0
- package/skills/research/deep-research/llm-scientific-discovery-guide/SKILL.md +178 -0
- package/skills/research/deep-research/local-deep-research-guide/SKILL.md +253 -0
- package/skills/research/deep-research/open-researcher-guide/SKILL.md +138 -0
- package/skills/research/deep-research/tongyi-deep-research-guide/SKILL.md +217 -0
- package/skills/research/funding/eu-horizon-guide/SKILL.md +244 -0
- package/skills/research/funding/grant-budget-guide/SKILL.md +284 -0
- package/skills/research/funding/nih-reporter-api-guide/SKILL.md +166 -0
- package/skills/research/funding/nsf-award-api-guide/SKILL.md +133 -0
- package/skills/research/methodology/academic-mentor-guide/SKILL.md +169 -0
- package/skills/research/methodology/claude-scientific-guide/SKILL.md +122 -0
- package/skills/research/methodology/deep-innovator-guide/SKILL.md +242 -0
- package/skills/research/methodology/osf-api-guide/SKILL.md +165 -0
- package/skills/research/methodology/parsifal-slr-guide/SKILL.md +154 -0
- package/skills/research/methodology/research-paper-kb/SKILL.md +263 -0
- package/skills/research/methodology/research-pipeline-units-guide/SKILL.md +169 -0
- package/skills/research/methodology/research-town-guide/SKILL.md +263 -0
- package/skills/research/methodology/slr-automation-guide/SKILL.md +235 -0
- package/skills/research/paper-review/automated-review-guide/SKILL.md +281 -0
- package/skills/research/paper-review/latte-review-guide/SKILL.md +175 -0
- package/skills/research/paper-review/paper-compare-guide/SKILL.md +238 -0
- package/skills/research/paper-review/paper-critique-framework/SKILL.md +181 -0
- package/skills/research/paper-review/paper-digest-guide/SKILL.md +240 -0
- package/skills/research/paper-review/paper-research-assistant/SKILL.md +231 -0
- package/skills/research/paper-review/research-quality-filter/SKILL.md +261 -0
- package/skills/research/paper-review/review-response-guide/SKILL.md +275 -0
- package/skills/tools/code-exec/contextplus-mcp-guide/SKILL.md +110 -0
- package/skills/tools/code-exec/google-colab-guide/SKILL.md +276 -0
- package/skills/tools/code-exec/kaggle-api-guide/SKILL.md +216 -0
- package/skills/tools/code-exec/overleaf-cli-guide/SKILL.md +279 -0
- package/skills/tools/diagram/clawphd-guide/SKILL.md +149 -0
- package/skills/tools/diagram/code-flow-visualizer/SKILL.md +197 -0
- package/skills/tools/diagram/excalidraw-diagram-guide/SKILL.md +170 -0
- package/skills/tools/diagram/json-data-visualizer/SKILL.md +270 -0
- package/skills/tools/diagram/kroki-diagram-api/SKILL.md +198 -0
- package/skills/tools/diagram/mermaid-architect-guide/SKILL.md +219 -0
- package/skills/tools/diagram/scientific-graphical-abstract/SKILL.md +201 -0
- package/skills/tools/diagram/tldraw-whiteboard-guide/SKILL.md +397 -0
- package/skills/tools/document/docsgpt-guide/SKILL.md +130 -0
- package/skills/tools/document/large-document-reader/SKILL.md +202 -0
- package/skills/tools/document/md2pdf-xelatex/SKILL.md +212 -0
- package/skills/tools/document/openpaper-guide/SKILL.md +232 -0
- package/skills/tools/document/paper-parse-guide/SKILL.md +243 -0
- package/skills/tools/document/weknora-guide/SKILL.md +216 -0
- package/skills/tools/document/zotero-addon-market-guide/SKILL.md +108 -0
- package/skills/tools/document/zotero-night-theme-guide/SKILL.md +142 -0
- package/skills/tools/document/zotero-style-guide/SKILL.md +217 -0
- package/skills/tools/knowledge-graph/citation-network-builder/SKILL.md +244 -0
- package/skills/tools/knowledge-graph/concept-map-generator/SKILL.md +284 -0
- package/skills/tools/knowledge-graph/graphiti-guide/SKILL.md +219 -0
- package/skills/tools/knowledge-graph/mimir-memory-guide/SKILL.md +135 -0
- package/skills/tools/knowledge-graph/notero-zotero-notion-guide/SKILL.md +187 -0
- package/skills/tools/knowledge-graph/open-webui-tools-guide/SKILL.md +156 -0
- package/skills/tools/knowledge-graph/openspg-guide/SKILL.md +210 -0
- package/skills/tools/knowledge-graph/paperpile-notion-guide/SKILL.md +84 -0
- package/skills/tools/knowledge-graph/zotero-markdb-connect-guide/SKILL.md +162 -0
- package/skills/tools/ocr-translate/latex-translation-guide/SKILL.md +176 -0
- package/skills/tools/ocr-translate/math-equation-renderer/SKILL.md +198 -0
- package/skills/tools/ocr-translate/pdf-math-translate-guide/SKILL.md +141 -0
- package/skills/tools/ocr-translate/zotero-pdf-translate-guide/SKILL.md +95 -0
- package/skills/tools/ocr-translate/zotero-pdf2zh-guide/SKILL.md +143 -0
- package/skills/tools/scraping/dataset-finder-guide/SKILL.md +253 -0
- package/skills/tools/scraping/easy-spider-guide/SKILL.md +250 -0
- package/skills/tools/scraping/google-scholar-scraper/SKILL.md +255 -0
- package/skills/tools/scraping/repository-harvesting-guide/SKILL.md +310 -0
- package/skills/writing/citation/academic-citation-manager/SKILL.md +314 -0
- package/skills/writing/citation/academic-citation-manager-guide/SKILL.md +182 -0
- package/skills/writing/citation/citation-assistant-skill/SKILL.md +192 -0
- package/skills/writing/citation/jabref-reference-guide/SKILL.md +127 -0
- package/skills/writing/citation/jasminum-zotero-guide/SKILL.md +103 -0
- package/skills/writing/citation/mendeley-api/SKILL.md +231 -0
- package/skills/writing/citation/obsidian-citation-guide/SKILL.md +164 -0
- package/skills/writing/citation/obsidian-zotero-guide/SKILL.md +137 -0
- package/skills/writing/citation/onecite-reference-guide/SKILL.md +168 -0
- package/skills/writing/citation/papersgpt-zotero-guide/SKILL.md +132 -0
- package/skills/writing/citation/papis-cli-guide/SKILL.md +213 -0
- package/skills/writing/citation/zotero-better-bibtex-guide/SKILL.md +107 -0
- package/skills/writing/citation/zotero-better-notes-guide/SKILL.md +121 -0
- package/skills/writing/citation/zotero-gpt-guide/SKILL.md +111 -0
- package/skills/writing/citation/zotero-mcp-guide/SKILL.md +164 -0
- package/skills/writing/citation/zotero-mdnotes-guide/SKILL.md +162 -0
- package/skills/writing/citation/zotero-reference-guide/SKILL.md +139 -0
- package/skills/writing/citation/zotero-scholar-guide/SKILL.md +294 -0
- package/skills/writing/citation/zotfile-attachment-guide/SKILL.md +140 -0
- package/skills/writing/composition/ml-paper-writing/SKILL.md +163 -0
- package/skills/writing/composition/opendraft-thesis-guide/SKILL.md +200 -0
- package/skills/writing/composition/paper-debugger-guide/SKILL.md +143 -0
- package/skills/writing/composition/paperforge-guide/SKILL.md +205 -0
- package/skills/writing/composition/research-paper-writer/SKILL.md +226 -0
- package/skills/writing/composition/scientific-writing-resources/SKILL.md +151 -0
- package/skills/writing/composition/scientific-writing-wrapper/SKILL.md +153 -0
- package/skills/writing/latex/academic-writing-latex/SKILL.md +285 -0
- package/skills/writing/latex/latex-drawing-collection/SKILL.md +154 -0
- package/skills/writing/latex/latex-templates-collection/SKILL.md +159 -0
- package/skills/writing/latex/md-to-pdf-academic/SKILL.md +230 -0
- package/skills/writing/latex/tex-render-guide/SKILL.md +243 -0
- package/skills/writing/polish/academic-tone-guide/SKILL.md +209 -0
- package/skills/writing/polish/chinese-text-humanizer/SKILL.md +140 -0
- package/skills/writing/polish/conciseness-editing-guide/SKILL.md +225 -0
- package/skills/writing/polish/paper-polish-guide/SKILL.md +160 -0
- package/skills/writing/templates/arxiv-preprint-template/SKILL.md +184 -0
- package/skills/writing/templates/elegant-paper-template/SKILL.md +141 -0
- package/skills/writing/templates/graphical-abstract-guide/SKILL.md +183 -0
- package/skills/writing/templates/novathesis-guide/SKILL.md +152 -0
- package/skills/writing/templates/scientific-article-pdf/SKILL.md +261 -0
- package/skills/writing/templates/sjtuthesis-guide/SKILL.md +197 -0
- package/skills/writing/templates/thuthesis-guide/SKILL.md +181 -0
- package/skills/literature/fulltext/repository-harvesting-guide/SKILL.md +0 -207
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pytorch-lightning-guide
|
|
3
|
+
description: "PyTorch Lightning framework for scalable model training and research"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "⚡"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["pytorch-lightning", "training", "distributed", "finetuning", "scalability", "research"]
|
|
10
|
+
source: "https://github.com/Lightning-AI/pytorch-lightning"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PyTorch Lightning Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
PyTorch Lightning is a deep learning framework with over 31,000 GitHub stars that provides a high-level interface for PyTorch, enabling researchers to focus on model design rather than engineering boilerplate. Developed by Lightning AI, it decouples the science (model architecture, loss functions, data processing) from the engineering (distributed training, mixed precision, gradient accumulation, checkpointing) through a structured `LightningModule` abstraction.
|
|
18
|
+
|
|
19
|
+
For academic researchers, Lightning eliminates the need to write repetitive training loops, device management code, and distributed training logic. You define your model, training step, and data loaders, and Lightning handles everything else -- from single GPU to multi-node distributed training, from FP32 to mixed precision, from local development to cloud deployment. This means faster iteration on research ideas with production-quality training infrastructure.
|
|
20
|
+
|
|
21
|
+
Lightning is used extensively in AI research labs and has become a standard tool for reproducible deep learning experiments. It integrates seamlessly with experiment tracking tools like Weights & Biases, MLflow, and TensorBoard, and supports all PyTorch-compatible model architectures.
|
|
22
|
+
|
|
23
|
+
## Installation and Setup
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install PyTorch Lightning
|
|
27
|
+
pip install lightning
|
|
28
|
+
|
|
29
|
+
# Or install with specific extras
|
|
30
|
+
pip install lightning[extra]
|
|
31
|
+
|
|
32
|
+
# For development/research with all features
|
|
33
|
+
pip install lightning[all]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Lightning requires Python 3.9+ and PyTorch 2.1+. For GPU training, ensure your PyTorch installation includes CUDA support:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Check GPU availability
|
|
40
|
+
python -c "import torch; print(torch.cuda.is_available())"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Verify your installation:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import lightning as L
|
|
47
|
+
print(L.__version__)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Core Architecture
|
|
51
|
+
|
|
52
|
+
### The LightningModule
|
|
53
|
+
|
|
54
|
+
The `LightningModule` is the central abstraction. It organizes your PyTorch code into clearly defined methods:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import lightning as L
|
|
58
|
+
import torch
|
|
59
|
+
import torch.nn.functional as F
|
|
60
|
+
from torch import nn
|
|
61
|
+
|
|
62
|
+
class ResearchModel(L.LightningModule):
|
|
63
|
+
def __init__(self, input_dim, hidden_dim, output_dim, lr=1e-3):
|
|
64
|
+
super().__init__()
|
|
65
|
+
self.save_hyperparameters()
|
|
66
|
+
self.encoder = nn.Sequential(
|
|
67
|
+
nn.Linear(input_dim, hidden_dim),
|
|
68
|
+
nn.ReLU(),
|
|
69
|
+
nn.Dropout(0.2),
|
|
70
|
+
nn.Linear(hidden_dim, hidden_dim),
|
|
71
|
+
nn.ReLU(),
|
|
72
|
+
)
|
|
73
|
+
self.classifier = nn.Linear(hidden_dim, output_dim)
|
|
74
|
+
self.lr = lr
|
|
75
|
+
|
|
76
|
+
def forward(self, x):
|
|
77
|
+
features = self.encoder(x)
|
|
78
|
+
return self.classifier(features)
|
|
79
|
+
|
|
80
|
+
def training_step(self, batch, batch_idx):
|
|
81
|
+
x, y = batch
|
|
82
|
+
logits = self(x)
|
|
83
|
+
loss = F.cross_entropy(logits, y)
|
|
84
|
+
acc = (logits.argmax(dim=-1) == y).float().mean()
|
|
85
|
+
self.log("train_loss", loss, prog_bar=True)
|
|
86
|
+
self.log("train_acc", acc, prog_bar=True)
|
|
87
|
+
return loss
|
|
88
|
+
|
|
89
|
+
def validation_step(self, batch, batch_idx):
|
|
90
|
+
x, y = batch
|
|
91
|
+
logits = self(x)
|
|
92
|
+
loss = F.cross_entropy(logits, y)
|
|
93
|
+
acc = (logits.argmax(dim=-1) == y).float().mean()
|
|
94
|
+
self.log("val_loss", loss, prog_bar=True)
|
|
95
|
+
self.log("val_acc", acc, prog_bar=True)
|
|
96
|
+
|
|
97
|
+
def configure_optimizers(self):
|
|
98
|
+
optimizer = torch.optim.AdamW(self.parameters(), lr=self.lr)
|
|
99
|
+
scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(
|
|
100
|
+
optimizer, T_max=self.trainer.max_epochs
|
|
101
|
+
)
|
|
102
|
+
return [optimizer], [scheduler]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### The LightningDataModule
|
|
106
|
+
|
|
107
|
+
Encapsulate all data processing in a reusable `LightningDataModule`:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
class ResearchDataModule(L.LightningDataModule):
|
|
111
|
+
def __init__(self, data_dir, batch_size=32, num_workers=4):
|
|
112
|
+
super().__init__()
|
|
113
|
+
self.data_dir = data_dir
|
|
114
|
+
self.batch_size = batch_size
|
|
115
|
+
self.num_workers = num_workers
|
|
116
|
+
|
|
117
|
+
def setup(self, stage=None):
|
|
118
|
+
# Load and split data
|
|
119
|
+
dataset = load_research_dataset(self.data_dir)
|
|
120
|
+
self.train_data, self.val_data, self.test_data = random_split(
|
|
121
|
+
dataset, [0.8, 0.1, 0.1]
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
def train_dataloader(self):
|
|
125
|
+
return DataLoader(self.train_data, batch_size=self.batch_size,
|
|
126
|
+
shuffle=True, num_workers=self.num_workers)
|
|
127
|
+
|
|
128
|
+
def val_dataloader(self):
|
|
129
|
+
return DataLoader(self.val_data, batch_size=self.batch_size,
|
|
130
|
+
num_workers=self.num_workers)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### The Trainer
|
|
134
|
+
|
|
135
|
+
The `Trainer` orchestrates everything with a rich set of configuration options:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
trainer = L.Trainer(
|
|
139
|
+
max_epochs=100,
|
|
140
|
+
accelerator="gpu",
|
|
141
|
+
devices=4,
|
|
142
|
+
strategy="ddp",
|
|
143
|
+
precision="16-mixed",
|
|
144
|
+
gradient_clip_val=1.0,
|
|
145
|
+
accumulate_grad_batches=4,
|
|
146
|
+
callbacks=[
|
|
147
|
+
L.callbacks.EarlyStopping(monitor="val_loss", patience=10),
|
|
148
|
+
L.callbacks.ModelCheckpoint(monitor="val_loss", save_top_k=3),
|
|
149
|
+
L.callbacks.LearningRateMonitor(),
|
|
150
|
+
],
|
|
151
|
+
logger=L.loggers.WandbLogger(project="my-research"),
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
# Train the model
|
|
155
|
+
trainer.fit(model, datamodule=data_module)
|
|
156
|
+
|
|
157
|
+
# Test with best checkpoint
|
|
158
|
+
trainer.test(model, datamodule=data_module, ckpt_path="best")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Advanced Research Features
|
|
162
|
+
|
|
163
|
+
### Distributed Training Strategies
|
|
164
|
+
|
|
165
|
+
Lightning supports multiple distributed training strategies out of the box:
|
|
166
|
+
|
|
167
|
+
- **DDP (Distributed Data Parallel)**: Standard multi-GPU training
|
|
168
|
+
- **FSDP (Fully Sharded Data Parallel)**: Memory-efficient training for large models
|
|
169
|
+
- **DeepSpeed**: ZeRO optimization stages 1, 2, and 3
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
# FSDP for large model training
|
|
173
|
+
trainer = L.Trainer(
|
|
174
|
+
strategy="fsdp",
|
|
175
|
+
devices=8,
|
|
176
|
+
precision="bf16-mixed",
|
|
177
|
+
)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Custom Training Loops
|
|
181
|
+
|
|
182
|
+
Override the training loop for non-standard research workflows like GANs, reinforcement learning, or meta-learning:
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
class GANModule(L.LightningModule):
|
|
186
|
+
def training_step(self, batch, batch_idx):
|
|
187
|
+
optimizer_g, optimizer_d = self.optimizers()
|
|
188
|
+
|
|
189
|
+
# Train discriminator
|
|
190
|
+
real_loss = self.discriminator_loss(batch, real=True)
|
|
191
|
+
fake_loss = self.discriminator_loss(batch, real=False)
|
|
192
|
+
d_loss = (real_loss + fake_loss) / 2
|
|
193
|
+
optimizer_d.zero_grad()
|
|
194
|
+
self.manual_backward(d_loss)
|
|
195
|
+
optimizer_d.step()
|
|
196
|
+
|
|
197
|
+
# Train generator
|
|
198
|
+
g_loss = self.generator_loss(batch)
|
|
199
|
+
optimizer_g.zero_grad()
|
|
200
|
+
self.manual_backward(g_loss)
|
|
201
|
+
optimizer_g.step()
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def automatic_optimization(self):
|
|
205
|
+
return False
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Profiling and Debugging
|
|
209
|
+
|
|
210
|
+
Built-in profiling tools help identify bottlenecks:
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
trainer = L.Trainer(
|
|
214
|
+
profiler="advanced", # or "simple", "pytorch"
|
|
215
|
+
detect_anomaly=True,
|
|
216
|
+
overfit_batches=10, # Quick sanity check
|
|
217
|
+
)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Experiment Reproducibility
|
|
221
|
+
|
|
222
|
+
Lightning has built-in support for reproducibility, which is critical for academic research:
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
# Seed everything for reproducibility
|
|
226
|
+
L.seed_everything(42, workers=True)
|
|
227
|
+
|
|
228
|
+
# Hyperparameters are automatically saved
|
|
229
|
+
model = ResearchModel(input_dim=768, hidden_dim=256, output_dim=10)
|
|
230
|
+
# model.hparams is automatically populated and logged
|
|
231
|
+
|
|
232
|
+
# Checkpoints include full training state
|
|
233
|
+
# Resume training from a checkpoint
|
|
234
|
+
trainer.fit(model, ckpt_path="path/to/checkpoint.ckpt")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
The `save_hyperparameters()` call in your module's `__init__` automatically tracks all constructor arguments, making experiment comparison straightforward.
|
|
238
|
+
|
|
239
|
+
## References
|
|
240
|
+
|
|
241
|
+
- Repository: https://github.com/Lightning-AI/pytorch-lightning
|
|
242
|
+
- Documentation: https://lightning.ai/docs/pytorch/stable/
|
|
243
|
+
- Lightning AI platform: https://lightning.ai/
|
|
244
|
+
- Migration guide from vanilla PyTorch: https://lightning.ai/docs/pytorch/stable/starter/converting.html
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: responsible-ai-guide
|
|
3
|
+
description: "Resources for trustworthy, fair, and ethical AI research"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "⚖️"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["responsible AI", "AI ethics", "fairness", "trustworthy AI", "AI safety", "bias"]
|
|
10
|
+
source: "https://github.com/AthenaCore/AwesomeResponsibleAI"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Responsible AI Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
A comprehensive collection of resources for building trustworthy, fair, and ethical AI systems. Covers fairness metrics, bias detection and mitigation, explainability methods, privacy-preserving techniques, robustness testing, and governance frameworks. Essential reading for researchers working on AI safety, alignment, and deploying models in high-stakes domains.
|
|
18
|
+
|
|
19
|
+
## Topic Taxonomy
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Responsible AI
|
|
23
|
+
├── Fairness
|
|
24
|
+
│ ├── Bias detection (data, model, outcome)
|
|
25
|
+
│ ├── Fairness metrics (demographic parity, equalized odds)
|
|
26
|
+
│ ├── Bias mitigation (pre/in/post-processing)
|
|
27
|
+
│ └── Intersectional fairness
|
|
28
|
+
├── Explainability
|
|
29
|
+
│ ├── Feature attribution (SHAP, LIME, IG)
|
|
30
|
+
│ ├── Concept-based (TCAV, concept bottleneck)
|
|
31
|
+
│ ├── Counterfactual explanations
|
|
32
|
+
│ └── Mechanistic interpretability
|
|
33
|
+
├── Privacy
|
|
34
|
+
│ ├── Differential privacy
|
|
35
|
+
│ ├── Federated learning
|
|
36
|
+
│ ├── Membership inference attacks
|
|
37
|
+
│ └── Machine unlearning
|
|
38
|
+
├── Robustness
|
|
39
|
+
│ ├── Adversarial attacks/defenses
|
|
40
|
+
│ ├── Distribution shift
|
|
41
|
+
│ ├── Uncertainty quantification
|
|
42
|
+
│ └── Out-of-distribution detection
|
|
43
|
+
├── Safety & Alignment
|
|
44
|
+
│ ├── RLHF and preference learning
|
|
45
|
+
│ ├── Constitutional AI
|
|
46
|
+
│ ├── Red teaming
|
|
47
|
+
│ └── Guardrails and filters
|
|
48
|
+
└── Governance
|
|
49
|
+
├── Model cards
|
|
50
|
+
├── Datasheets for datasets
|
|
51
|
+
├── AI impact assessments
|
|
52
|
+
└── Regulatory compliance (EU AI Act)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Key Tools
|
|
56
|
+
|
|
57
|
+
| Tool | Category | Purpose |
|
|
58
|
+
|------|----------|---------|
|
|
59
|
+
| **Fairlearn** | Fairness | Bias assessment + mitigation |
|
|
60
|
+
| **AI Fairness 360** | Fairness | IBM fairness toolkit |
|
|
61
|
+
| **SHAP** | Explainability | Shapley value explanations |
|
|
62
|
+
| **Captum** | Explainability | PyTorch interpretability |
|
|
63
|
+
| **Opacus** | Privacy | Differential privacy for PyTorch |
|
|
64
|
+
| **ART** | Robustness | Adversarial robustness toolbox |
|
|
65
|
+
| **Alibi** | Explainability | ML model explanations |
|
|
66
|
+
|
|
67
|
+
## Fairness Assessment
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from fairlearn.metrics import MetricFrame
|
|
71
|
+
from sklearn.metrics import accuracy_score, recall_score
|
|
72
|
+
|
|
73
|
+
# Assess fairness across demographic groups
|
|
74
|
+
metrics = MetricFrame(
|
|
75
|
+
metrics={
|
|
76
|
+
"accuracy": accuracy_score,
|
|
77
|
+
"recall": recall_score,
|
|
78
|
+
},
|
|
79
|
+
y_true=y_test,
|
|
80
|
+
y_pred=y_pred,
|
|
81
|
+
sensitive_features=demographics,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
print("Overall:")
|
|
85
|
+
print(metrics.overall)
|
|
86
|
+
print("\nBy group:")
|
|
87
|
+
print(metrics.by_group)
|
|
88
|
+
print("\nDifference (max - min):")
|
|
89
|
+
print(metrics.difference())
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Reading Roadmap
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
### Foundations
|
|
96
|
+
1. "Fairness and Machine Learning" (Barocas, Hardt, Narayanan)
|
|
97
|
+
2. "Datasheets for Datasets" (Gebru et al., 2021)
|
|
98
|
+
3. "Model Cards for Model Reporting" (Mitchell et al., 2019)
|
|
99
|
+
|
|
100
|
+
### Fairness
|
|
101
|
+
4. "On Fairness and Calibration" (Pleiss et al., 2017)
|
|
102
|
+
5. "Fairness Through Awareness" (Dwork et al., 2012)
|
|
103
|
+
|
|
104
|
+
### Explainability
|
|
105
|
+
6. "A Unified Approach to Interpreting Model Predictions" (SHAP)
|
|
106
|
+
7. "Why Should I Trust You?" (LIME, Ribeiro et al., 2016)
|
|
107
|
+
|
|
108
|
+
### Safety
|
|
109
|
+
8. "Constitutional AI" (Bai et al., 2022)
|
|
110
|
+
9. "Red Teaming Language Models" (Perez et al., 2022)
|
|
111
|
+
10. "Scaling Monosemanticity" (Anthropic, 2024)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Use Cases
|
|
115
|
+
|
|
116
|
+
1. **Bias auditing**: Check models for demographic biases
|
|
117
|
+
2. **Compliance**: EU AI Act and regulatory requirements
|
|
118
|
+
3. **Model documentation**: Model cards and impact assessments
|
|
119
|
+
4. **Research ethics**: Ethical considerations for AI research
|
|
120
|
+
5. **Course material**: Teach responsible AI principles
|
|
121
|
+
|
|
122
|
+
## References
|
|
123
|
+
|
|
124
|
+
- [AwesomeResponsibleAI](https://github.com/AthenaCore/AwesomeResponsibleAI)
|
|
125
|
+
- [Fairlearn](https://fairlearn.org/)
|
|
126
|
+
- [EU AI Act](https://artificialintelligenceact.eu/)
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tensorflow-guide
|
|
3
|
+
description: "TensorFlow best practices for tf.function, GPU memory, and deployment"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🧮"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["TensorFlow", "tf.function", "GPU", "SavedModel", "distributed training", "XLA"]
|
|
10
|
+
source: "https://github.com/tensorflow/tensorflow"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# TensorFlow Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
TensorFlow is a production-grade machine learning framework that excels at deployment, distributed training, and hardware acceleration. While PyTorch dominates pure research prototyping, TensorFlow remains the standard in industry ML systems and is heavily used in applied research where models must move from experiment to production.
|
|
18
|
+
|
|
19
|
+
TensorFlow 2.x unified eager execution with graph-mode performance through `tf.function`, but this hybrid approach introduces subtle pitfalls. Understanding when and how TensorFlow traces functions, manages GPU memory, and distributes computation is essential for writing correct and efficient code.
|
|
20
|
+
|
|
21
|
+
This guide covers the key patterns that trip up researchers: `tf.function` tracing semantics, GPU memory management, distributed strategies, model export, and the ecosystem of tools (TFX, TensorBoard, TF Serving) that make TensorFlow uniquely powerful for end-to-end ML workflows.
|
|
22
|
+
|
|
23
|
+
## tf.function: The Critical Abstraction
|
|
24
|
+
|
|
25
|
+
### How Tracing Works
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import tensorflow as tf
|
|
29
|
+
|
|
30
|
+
@tf.function
|
|
31
|
+
def add(a, b):
|
|
32
|
+
print("Tracing!") # Runs only during tracing, NOT every call
|
|
33
|
+
tf.print("Executing!") # Runs every call (TF op)
|
|
34
|
+
return a + b
|
|
35
|
+
|
|
36
|
+
# First call with float32 shape (2,) -- traces
|
|
37
|
+
add(tf.constant([1.0, 2.0]), tf.constant([3.0, 4.0])) # Prints "Tracing!" + "Executing!"
|
|
38
|
+
|
|
39
|
+
# Second call with same signature -- reuses trace
|
|
40
|
+
add(tf.constant([5.0, 6.0]), tf.constant([7.0, 8.0])) # Prints only "Executing!"
|
|
41
|
+
|
|
42
|
+
# Third call with different dtype -- re-traces!
|
|
43
|
+
add(tf.constant([1, 2]), tf.constant([3, 4])) # Prints "Tracing!" + "Executing!"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Common tf.function Pitfalls
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
# PITFALL 1: Python side effects in tf.function
|
|
50
|
+
counter = 0
|
|
51
|
+
|
|
52
|
+
@tf.function
|
|
53
|
+
def increment():
|
|
54
|
+
global counter
|
|
55
|
+
counter += 1 # Only runs during tracing! counter stays at 1 forever.
|
|
56
|
+
return counter
|
|
57
|
+
|
|
58
|
+
# FIX: Use tf.Variable for mutable state
|
|
59
|
+
counter = tf.Variable(0)
|
|
60
|
+
|
|
61
|
+
@tf.function
|
|
62
|
+
def increment():
|
|
63
|
+
counter.assign_add(1)
|
|
64
|
+
return counter
|
|
65
|
+
|
|
66
|
+
# PITFALL 2: Creating variables inside tf.function
|
|
67
|
+
@tf.function
|
|
68
|
+
def bad_function(x):
|
|
69
|
+
w = tf.Variable(tf.random.normal([3, 3])) # ERROR on second call!
|
|
70
|
+
return x @ w
|
|
71
|
+
|
|
72
|
+
# FIX: Create variables outside, pass as arguments or use Keras layers
|
|
73
|
+
w = tf.Variable(tf.random.normal([3, 3]))
|
|
74
|
+
|
|
75
|
+
@tf.function
|
|
76
|
+
def good_function(x):
|
|
77
|
+
return x @ w
|
|
78
|
+
|
|
79
|
+
# PITFALL 3: Python lists that grow
|
|
80
|
+
@tf.function
|
|
81
|
+
def bad_accumulate(dataset):
|
|
82
|
+
results = []
|
|
83
|
+
for x in dataset:
|
|
84
|
+
results.append(x * 2) # Creates new trace on every iteration!
|
|
85
|
+
return results
|
|
86
|
+
|
|
87
|
+
# FIX: Use tf.TensorArray
|
|
88
|
+
@tf.function
|
|
89
|
+
def good_accumulate(dataset):
|
|
90
|
+
results = tf.TensorArray(tf.float32, size=0, dynamic_size=True)
|
|
91
|
+
for i, x in enumerate(dataset):
|
|
92
|
+
results = results.write(i, x * 2)
|
|
93
|
+
return results.stack()
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Input Signatures for Stable Tracing
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
@tf.function(input_signature=[
|
|
100
|
+
tf.TensorSpec(shape=[None, 224, 224, 3], dtype=tf.float32),
|
|
101
|
+
tf.TensorSpec(shape=[None], dtype=tf.int64),
|
|
102
|
+
])
|
|
103
|
+
def train_step(images, labels):
|
|
104
|
+
"""Fixed signature prevents re-tracing on different batch sizes."""
|
|
105
|
+
with tf.GradientTape() as tape:
|
|
106
|
+
predictions = model(images, training=True)
|
|
107
|
+
loss = loss_fn(labels, predictions)
|
|
108
|
+
gradients = tape.gradient(loss, model.trainable_variables)
|
|
109
|
+
optimizer.apply_gradients(zip(gradients, model.trainable_variables))
|
|
110
|
+
return loss
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## GPU Memory Management
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
# Problem: TensorFlow grabs ALL GPU memory by default
|
|
117
|
+
# Solution: Enable memory growth
|
|
118
|
+
|
|
119
|
+
gpus = tf.config.list_physical_devices("GPU")
|
|
120
|
+
for gpu in gpus:
|
|
121
|
+
tf.config.experimental.set_memory_growth(gpu, True)
|
|
122
|
+
|
|
123
|
+
# Alternative: Set a hard memory limit
|
|
124
|
+
tf.config.set_logical_device_configuration(
|
|
125
|
+
gpus[0],
|
|
126
|
+
[tf.config.LogicalDeviceConfiguration(memory_limit=8192)] # 8 GB
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Monitor memory usage
|
|
130
|
+
print(tf.config.experimental.get_memory_info("GPU:0"))
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Distributed Training Strategies
|
|
134
|
+
|
|
135
|
+
| Strategy | GPUs | Machines | Sync | Use Case |
|
|
136
|
+
|----------|------|----------|------|----------|
|
|
137
|
+
| `MirroredStrategy` | Multiple | 1 | Sync | Most common multi-GPU |
|
|
138
|
+
| `MultiWorkerMirroredStrategy` | Multiple | Multiple | Sync | Multi-node training |
|
|
139
|
+
| `TPUStrategy` | TPU cores | 1 pod | Sync | TPU training |
|
|
140
|
+
| `ParameterServerStrategy` | Multiple | Multiple | Async | Very large models |
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
# Multi-GPU training with MirroredStrategy
|
|
144
|
+
strategy = tf.distribute.MirroredStrategy()
|
|
145
|
+
print(f"Number of devices: {strategy.num_replicas_in_sync}")
|
|
146
|
+
|
|
147
|
+
with strategy.scope():
|
|
148
|
+
model = build_model()
|
|
149
|
+
model.compile(
|
|
150
|
+
optimizer=tf.keras.optimizers.Adam(learning_rate=0.001 * strategy.num_replicas_in_sync),
|
|
151
|
+
loss="sparse_categorical_crossentropy",
|
|
152
|
+
metrics=["accuracy"],
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
# Global batch size = per_replica_batch * num_replicas
|
|
156
|
+
global_batch_size = 32 * strategy.num_replicas_in_sync
|
|
157
|
+
dataset = dataset.batch(global_batch_size)
|
|
158
|
+
model.fit(dataset, epochs=10)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Model Export and Serving
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
# SavedModel: The universal export format
|
|
165
|
+
model.save("saved_model/my_model")
|
|
166
|
+
|
|
167
|
+
# Load with full TF capabilities
|
|
168
|
+
loaded = tf.saved_model.load("saved_model/my_model")
|
|
169
|
+
infer = loaded.signatures["serving_default"]
|
|
170
|
+
|
|
171
|
+
# TF Lite for mobile/edge deployment
|
|
172
|
+
converter = tf.lite.TFLiteConverter.from_saved_model("saved_model/my_model")
|
|
173
|
+
converter.optimizations = [tf.lite.Optimize.DEFAULT]
|
|
174
|
+
tflite_model = converter.convert()
|
|
175
|
+
|
|
176
|
+
with open("model.tflite", "wb") as f:
|
|
177
|
+
f.write(tflite_model)
|
|
178
|
+
|
|
179
|
+
# TensorFlow.js for browser deployment
|
|
180
|
+
# Command line:
|
|
181
|
+
# tensorflowjs_converter --input_format=tf_saved_model saved_model/my_model web_model/
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Performance Optimization with XLA
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
# XLA (Accelerated Linear Algebra) compiles tf.functions for hardware
|
|
188
|
+
@tf.function(jit_compile=True)
|
|
189
|
+
def fast_matmul(a, b):
|
|
190
|
+
return tf.matmul(a, b)
|
|
191
|
+
|
|
192
|
+
# Enable XLA globally for Keras
|
|
193
|
+
tf.config.optimizer.set_jit(True)
|
|
194
|
+
|
|
195
|
+
# Benchmark XLA vs non-XLA
|
|
196
|
+
import time
|
|
197
|
+
a = tf.random.normal([1024, 1024])
|
|
198
|
+
b = tf.random.normal([1024, 1024])
|
|
199
|
+
|
|
200
|
+
# Warm up
|
|
201
|
+
fast_matmul(a, b)
|
|
202
|
+
|
|
203
|
+
start = time.time()
|
|
204
|
+
for _ in range(1000):
|
|
205
|
+
fast_matmul(a, b)
|
|
206
|
+
print(f"XLA matmul: {time.time() - start:.3f}s")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Debugging and Profiling
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
# Enable eager mode for debugging
|
|
213
|
+
tf.config.run_functions_eagerly(True)
|
|
214
|
+
|
|
215
|
+
# TensorBoard profiler integration
|
|
216
|
+
log_dir = "logs/profile"
|
|
217
|
+
tf.profiler.experimental.start(log_dir)
|
|
218
|
+
# ... run training steps ...
|
|
219
|
+
tf.profiler.experimental.stop()
|
|
220
|
+
# View: tensorboard --logdir logs/profile
|
|
221
|
+
|
|
222
|
+
# Check for numerical issues
|
|
223
|
+
tf.debugging.enable_check_numerics() # Raises on NaN/Inf
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Best Practices
|
|
227
|
+
|
|
228
|
+
- **Set memory growth before any TF operations.** It must be the first GPU-related call.
|
|
229
|
+
- **Use `tf.function` with explicit `input_signature`** to prevent re-tracing in production.
|
|
230
|
+
- **Avoid Python control flow inside `tf.function`** unless you use `tf.cond` / `tf.while_loop`.
|
|
231
|
+
- **Profile with TensorBoard** before optimizing; identify whether you are CPU-bound, GPU-bound, or I/O-bound.
|
|
232
|
+
- **Use mixed precision** via `tf.keras.mixed_precision.set_global_policy("mixed_float16")` for modern GPUs.
|
|
233
|
+
- **Pin TF version in Docker images** for reproducible research -- different versions can produce different numerical results.
|
|
234
|
+
|
|
235
|
+
## References
|
|
236
|
+
|
|
237
|
+
- [TensorFlow documentation](https://www.tensorflow.org/guide) -- Official guides and API reference
|
|
238
|
+
- [Better performance with tf.function](https://www.tensorflow.org/guide/function) -- Tracing semantics deep dive
|
|
239
|
+
- [Distributed training guide](https://www.tensorflow.org/guide/distributed_training) -- Multi-GPU and multi-node patterns
|
|
240
|
+
- [TensorFlow Model Garden](https://github.com/tensorflow/models) -- Reference implementations of SOTA models
|
|
241
|
+
- [XLA documentation](https://www.tensorflow.org/xla) -- Hardware-accelerated compilation
|