[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-samre12--deep-trading-agent":3,"tool-samre12--deep-trading-agent":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",157379,2,"2026-04-15T23:32:42",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":10,"env_os":95,"env_gpu":96,"env_ram":96,"env_deps":97,"category_tags":104,"github_topics":105,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":114,"updated_at":115,"faqs":116,"releases":157},7994,"samre12\u002Fdeep-trading-agent","deep-trading-agent","Deep Reinforcement Learning based Trading Agent for Bitcoin","deep-trading-agent 是一款基于深度强化学习技术的比特币自动交易智能体。它旨在解决加密货币市场中因价格波动剧烈、人为情绪干扰而导致的交易决策难题，通过算法自动分析历史行情并执行买卖策略，以追求更稳定的投资回报。\n\n该工具主要适合具备一定编程基础的开发者和量化金融研究人员使用。用户需要熟悉 Python 环境及 TensorFlow 框架，以便进行模型训练、参数配置及结果监控。对于希望探索 AI 在金融领域应用的学术研究者，或想要构建自定义高频交易系统的开发者而言，这是一个极具价值的开源起点。\n\n其核心技术亮点在于采用了 DeepSense 神经网络架构来近似 Q 函数，从而更精准地评估交易动作的长期价值。不同于仅依赖收盘价的简单模型，deep-trading-agent 能够综合处理每分钟级别的多维数据，包括最高价、最低价、收盘价及交易量，并结合剩余交易次数等状态信息构建完整的市场感知。此外，项目提供了完善的 Docker 支持，用户可一键拉取预构建镜像快速启动训练环境，并通过 Tensorboard 实时可视化监控学习过程，大大降低了复现前沿算法的门槛。","# Deep Trading Agent\n\n[![license](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fl\u002Fdoctrine\u002Form.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fblob\u002Fmaster\u002FLICENSE)\n[![dep1](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fimplementation-tensorflow-orange.svg)](https:\u002F\u002Fwww.tensorflow.org\u002F)\n[![dep2](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-2.7-red.svg)](https:\u002F\u002Fwww.python.org\u002Fdownload\u002Freleases\u002F2.7\u002F)\n[![dep3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-in%20progress-green.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002F)\n[![dep4](https:\u002F\u002Fimg.shields.io\u002Fcircleci\u002Fproject\u002Fgithub\u002FRedSparr0w\u002Fnode-csgo-parser.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002F)\n[![dep4](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocker%20image-available-ff69b4.svg)](https:\u002F\u002Fcloud.docker.com\u002Fapp\u002Fsamre12\u002Frepository\u002Fdocker\u002Fsamre12\u002Fdeep-trading-agent\u002Fbuilds)\n\u003Cbr>\nDeep Reinforcement Learning based Trading Agent for Bitcoin using [DeepSense](https:\u002F\u002Farxiv.org\u002Fabs\u002F1611.01942) Network for Q function approximation. \u003Cbr>\u003Cbr>\n![model](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsamre12_deep-trading-agent_readme_c49a71d1dd22.png)\n\u003Cbr>\nFor complete details of the dataset, preprocessing, network architecture and implementation, refer to the [Wiki](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fwiki) of this repository.\n\n## Requirements\n\n- Python 2.7\n- [Tensorflow](https:\u002F\u002Fwww.tensorflow.org\u002F)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org) (for pre-processing Bitcoin Price Series)\n- [tqdm](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ftqdm) (for displaying progress of training)\u003Cbr>\n\nTo setup a ubuntu virtual machine with all the dependencies to run the code, refer to [`assets\u002Fvm`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Ftree\u002Fmaster\u002Fassets\u002Fvm).\n\n## Run with Docker\n\nPull the prebuilt docker image directly from docker hub and run it as\n\n```bash\ndocker pull samre12\u002Fdeep-trading-agent:latest\ndocker run -p 6006:6006 -it samre12\u002Fdeep-trading-agent:latest\n```\n\n**OR**\u003Cbr>\n\nBuild the docker image locally by executing the command and the run the image as\n\n```bash\ndocker build -t deep-trading-agent .\ndocker run -p 6006:6006 -it deep-trading-agent\n```\n\nThis will setup the repository for training the agent and\n\n- mount the current directory into `\u002Fdeep-trading-agent` in the container\n\n- during image build, the latest transactions history from the exchange is pulled and sampled to create per-minute scale dataset of Bitcoin prices. This dataset is placed at `\u002Fdeep-trading-agent\u002Fdata\u002Fbtc.csv`\n\n- to initiate training of the agent, specify suitable parameters in a config file (an example config file is provided at `\u002Fdeep-trading-agent\u002Fcode\u002Fconfig\u002Fconfig.cfg`) and run the code using `\u002Fdeep-trading-agent\u002Fcode\u002Fmain.py`\n\n- training supports logging and monitoring through *Tensorboard*\n\n- `vim` and `screen` are installed in the container to edit the configuration files and run `tensorboard`\n\n- bind port *6006* of container to *6006* of host machine to monitor training using *Tensorboard*\n\n## Support\n\nPlease give a :star: to this repository to support the project :smile:.\n\n## ToDo\n\n### Docker Support\n\n- [X] Add Docker support for a fast and easy start with the project\n\n### Improve Model performance\n\n- [X] Extract highest and lowest prices and the volume of Bitcoin traded within a given time interval in the [`Preprocessor`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fblob\u002Ff8b5604aac3e68905034e4a0597867f37cecb342\u002Fcode\u002Fprocess\u002Fprocessor.py#L9)\n- [X] Use closing, highest, lowest prices and the volume traded as input channels to the model (remove features calculated just using closing prices)\n- [X] Normalize the price tensors using the price of the previous time step\n- [X] For the complete state representation, input the remaining number of trades to the model\n- [X] Use separate diff price blocks to calculate the unrealized PnL\n- [ ] Use [exponentially decayed weighted unrealized PnL](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fwiki\u002FReward-Function#exponentially-weighted-unrealized-pnl) as a reward function to incorporate current state of investment and stabilize the learning of the agent\n\n## Trading Model\n\nis inspired by [Deep Q-Trading](http:\u002F\u002Fcslt.riit.tsinghua.edu.cn\u002Fmediawiki\u002Fimages\u002F5\u002F5f\u002FDtq.pdf) where they solve a simplified trading problem for a single asset.\n\u003Cbr>\nFor each trading unit, only one of the three actions: neutral(1), long(2) and short(3) are allowed and a reward is obtained depending upon the current position of agent. Deep Q-Learning agent is trained to maximize the total accumulated rewards. \u003Cbr>\nCurrent Deep Q-Trading model is modified by using the *Deep Sense* architecture for *Q function* approximation.\n\n## Dataset\n\nPer minute Bitcoin series is obtained by modifying the procedure mentioned in [this](https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fdeep-learning-bitcoin) repository. Transactions in the *Coinbase* exchange are sampled to generate the Bitcoin price series. \u003Cbr>\nRefer to [`assets\u002Fdataset`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Ftree\u002Fmaster\u002Fassets\u002Fdataset) to download the dataset.\n\n### Preprocessing\n\n**Basic Preprocessing**\u003Cbr>\nCompletely ignore missing values and remove them from the dataset and accumulate blocks of continuous values using the timestamps of the prices.\u003Cbr>\nAll the accumulated blocks with number of timestamps lesser than the combined *history length* of the state and *horizon* of the agent are then filtered out since they cannot be used for training of the agent.\u003Cbr>\nIn the current implementation, past 3 hours (180 minutes) of per minute Bitcoin prices are used to generate the representation of the current state of the agent.\u003Cbr>\nWith the existing dataset (at the time of writing), following are the logs generated while preprocessing the dataset:\n```\nINFO:root:Number of blocks of continuous prices found are 58863\nINFO:root:Number of usable blocks obtained from the dataset are 887\nINFO:root:Number of distinct episodes for the current configuration are 558471\n```\n\n**Advanced Preprocessing**\u003Cbr>\nProcess missing values and concatenate smaller blocks to increase the sizes of continuous price blocks.\u003Cbr>\nStandard technique in literature to fill the missing values in a way that does not much affect the performance of the model is using exponential filling with no decay.\u003Cbr>\n*(To be implemented)*\n\n## Implementation\n\nTensorflow \"1.1.0\" version is used for the implementation of the **Deep Sense** network.\u003Cbr>\n\n### Deep Sense\n\nImplementation is adapted from [this](https:\u002F\u002Fgithub.com\u002Fyscacaca\u002FDeepSense) Github repository with a few simplifications in the network architecture to incorporate learning over a single time series of the Bitcoin data.\n\n### Deep Q Trading\n\nImplementation and preprocessing is inspired from this [Medium post](https:\u002F\u002Fhackernoon.com\u002Fthe-self-learning-quant-d3329fcc9915). The actual implementation of the Deep Q Network is adapted from [DQN-tensorflow](https:\u002F\u002Fgithub.com\u002Fdevsisters\u002FDQN-tensorflow).\n","# 深度交易智能体\n\n[![license](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fl\u002Fdoctrine\u002Form.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fblob\u002Fmaster\u002FLICENSE)\n[![dep1](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fimplementation-tensorflow-orange.svg)](https:\u002F\u002Fwww.tensorflow.org\u002F)\n[![dep2](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-2.7-red.svg)](https:\u002F\u002Fwww.python.org\u002Fdownload\u002Freleases\u002F2.7\u002F)\n[![dep3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-in%20progress-green.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002F)\n[![dep4](https:\u002F\u002Fimg.shields.io\u002Fcircleci\u002Fproject\u002Fgithub\u002FRedSparr0w\u002Fnode-csgo-parser.svg)](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002F)\n[![dep4](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocker%20image-available-ff69b4.svg)](https:\u002F\u002Fcloud.docker.com\u002Fapp\u002Fsamre12\u002Frepository\u002Fdocker\u002Fsamre12\u002Fdeep-trading-agent\u002Fbuilds)\n\u003Cbr>\n基于深度强化学习的比特币交易智能体，采用 [DeepSense](https:\u002F\u002Farxiv.org\u002Fabs\u002F1611.01942) 网络进行 Q 函数近似。\u003Cbr>\u003Cbr>\n![model](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsamre12_deep-trading-agent_readme_c49a71d1dd22.png)\n\u003Cbr>\n有关数据集、预处理、网络架构及实现的完整细节，请参阅本仓库的 [Wiki](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fwiki)。\n\n## 需求\n\n- Python 2.7\n- [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org)（用于比特币价格序列的预处理）\n- [tqdm](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ftqdm)（用于显示训练进度）\u003Cbr>\n\n如需搭建包含所有依赖项的 Ubuntu 虚拟机以运行代码，请参考 [`assets\u002Fvm`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Ftree\u002Fmaster\u002Fassets\u002Fvm)。\n\n## 使用 Docker 运行\n\n直接从 Docker Hub 拉取预构建的 Docker 镜像并运行：\n\n```bash\ndocker pull samre12\u002Fdeep-trading-agent:latest\ndocker run -p 6006:6006 -it samre12\u002Fdeep-trading-agent:latest\n```\n\n**或者**\u003Cbr>\n\n在本地构建 Docker 镜像并运行：\n\n```bash\ndocker build -t deep-trading-agent .\ndocker run -p 6006:6006 -it deep-trading-agent\n```\n\n这将为训练智能体设置环境，并完成以下操作：\n- 将当前目录挂载到容器内的 `\u002Fdeep-trading-agent`\n- 在镜像构建过程中，会从交易所拉取最新的交易历史并采样，生成每分钟尺度的比特币价格数据集，该数据集位于 `\u002Fdeep-trading-agent\u002Fdata\u002Fbtc.csv`\n- 要启动智能体的训练，需在配置文件中指定合适的参数（示例配置文件位于 `\u002Fdeep-trading-agent\u002Fcode\u002Fconfig\u002Fconfig.cfg`），然后使用 `\u002Fdeep-trading-agent\u002Fcode\u002Fmain.py` 运行代码。\n- 训练支持通过 *TensorBoard* 进行日志记录和监控。\n- 容器内已安装 `vim` 和 `screen`，以便编辑配置文件和运行 `tensorboard`。\n- 将容器的端口 *6006* 绑定到宿主机的 *6006*，以便使用 *TensorBoard* 监控训练过程。\n\n## 支持\n\n请为本仓库点赞 :star:，以支持该项目 :smile:。\n\n## 待办事项\n\n### Docker 支持\n\n- [X] 添加 Docker 支持，以便快速简便地开始项目。\n\n### 提升模型性能\n\n- [X] 从 [`Preprocessor`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fblob\u002Ff8b5604aac3e68905034e4a0597867f37cecb342\u002Fcode\u002Fprocess\u002Fprocessor.py#L9) 中提取给定时间区间内的最高价、最低价以及比特币成交量。\n- [X] 将收盘价、最高价、最低价及成交量作为模型的输入通道（移除仅基于收盘价计算的特征）。\n- [X] 使用前一时间步的价格对价格张量进行归一化。\n- [X] 为了更完整的状态表示，将剩余的交易次数输入模型。\n- [X] 使用独立的价格差分块来计算未实现盈亏。\n- [ ] 使用 [指数衰减加权的未实现盈亏](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fwiki\u002FReward-Function#exponentially-weighted-unrealized-pnl) 作为奖励函数，以纳入当前投资状态并稳定智能体的学习。\n\n## 交易模型\n\n灵感来源于 [Deep Q-Trading](http:\u002F\u002Fcslt.riit.tsinghua.edu.cn\u002Fmediawiki\u002Fimages\u002F5\u002F5f\u002FDtq.pdf)，其中他们解决了一个针对单一资产的简化交易问题。\u003Cbr>\n对于每个交易单位，只允许三种动作：中性（1）、做多（2）和做空（3），奖励取决于智能体的当前持仓。深度 Q 学习智能体被训练以最大化累计奖励。\u003Cbr>\n当前的 Deep Q-Trading 模型通过使用 *Deep Sense* 架构来近似 *Q 函数* 进行了改进。\n\n## 数据集\n\n每分钟比特币价格序列是通过修改 [this](https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fdeep-learning-bitcoin) 仓库中提到的方法获得的。从 *Coinbase* 交易所抽取交易数据，生成比特币价格序列。\u003Cbr>\n请参阅 [`assets\u002Fdataset`](https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Ftree\u002Fmaster\u002Fassets\u002Fdataset) 下载数据集。\n\n### 预处理\n\n**基础预处理**\u003Cbr>\n完全忽略缺失值并将它们从数据集中移除，同时利用价格的时间戳将连续值分组。\u003Cbr>\n所有时间戳数量少于智能体状态 *历史长度* 与 *视野* 之和的分组都将被过滤掉，因为这些分组无法用于训练智能体。\u003Cbr>\n在当前实现中，过去 3 小时（180 分钟）的每分钟比特币价格被用来生成智能体的当前状态表示。\u003Cbr>\n根据现有数据集（截至撰写时），预处理过程中生成的日志如下：\n```\nINFO:root:找到的连续价格分组数为 58863\nINFO:root:从数据集中获取的可用分组数为 887\nINFO:root:当前配置下的不同 episode 数为 558471\n```\n\n**高级预处理**\u003Cbr>\n处理缺失值，并将较小的分组拼接起来，以增加连续价格分组的大小。\u003Cbr>\n文献中常用的标准方法是在不显著影响模型性能的情况下，使用无衰减的指数填充来填补缺失值。\u003Cbr>\n*(待实现)*\n\n## 实现\n\n采用 TensorFlow “1.1.0” 版本实现 **Deep Sense** 网络。\u003Cbr>\n\n### Deep Sense\n\n实现改编自 [this](https:\u002F\u002Fgithub.com\u002Fyscacaca\u002FDeepSense) 的 GitHub 仓库，并对网络架构进行了一些简化，以便适应单一时序的比特币数据学习。\n\n### Deep Q Trading\n\n实现和预处理受到这篇 [Medium 文章](https:\u002F\u002Fhackernoon.com\u002Fthe-self-learning-quant-d3329fcc9915) 的启发。实际的 Deep Q Network 实现则改编自 [DQN-tensorflow](https:\u002F\u002Fgithub.com\u002Fdevsisters\u002FDQN-tensorflow)。","# Deep Trading Agent 快速上手指南\n\nDeep Trading Agent 是一个基于深度强化学习（Deep Reinforcement Learning）的比特币交易代理。该项目使用 **DeepSense** 网络架构来近似 Q 函数，旨在通过历史价格数据训练智能体执行买入（Long）、卖出（Short）或观望（Neutral）操作以最大化累积奖励。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求。由于项目基于较早期的技术栈，请注意版本兼容性。\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu) 或 macOS。Windows 用户建议使用 WSL 或 Docker。\n- **Python 版本**: Python 2.7 (注意：该项目尚未迁移至 Python 3)。\n\n### 前置依赖\n如果您选择本地安装而非使用 Docker，需要手动安装以下库：\n- [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F) (版本 1.1.0)\n- Pandas (用于比特币价格序列预处理)\n- tqdm (用于显示训练进度)\n\n> **提示**: 考虑到 Python 2.7 和环境配置的复杂性，**强烈推荐使用 Docker 方式运行**，这是最快捷且无依赖冲突的方案。\n\n---\n\n## 安装步骤\n\n本项目提供两种安装方式：直接使用预构建的 Docker 镜像（推荐）或本地源码构建。\n\n### 方案一：使用 Docker（推荐）\n\n这是最简单的方式，无需手动配置 Python 环境和依赖库。\n\n1. **拉取镜像并运行**\n   直接从 Docker Hub 拉取最新镜像并启动容器：\n   ```bash\n   docker pull samre12\u002Fdeep-trading-agent:latest\n   docker run -p 6006:6006 -it samre12\u002Fdeep-trading-agent:latest\n   ```\n\n2. **或者：本地构建镜像**\n   如果您希望基于当前代码构建镜像：\n   ```bash\n   docker build -t deep-trading-agent .\n   docker run -p 6006:6006 -it deep-trading-agent\n   ```\n\n**容器内环境说明：**\n- 当前目录已挂载到容器内的 `\u002Fdeep-trading-agent`。\n- 镜像构建时会自动从交易所拉取最新的交易历史，并采样生成分钟级的比特币价格数据集 (`\u002Fdeep-trading-agent\u002Fdata\u002Fbtc.csv`)。\n- 容器内已预装 `vim` 和 `screen`，方便编辑配置文件和管理后台进程。\n- 端口 `6006` 已映射，可用于通过宿主机的浏览器访问 TensorBoard 监控训练。\n\n### 方案二：本地环境安装（仅限高级用户）\n\n如果您必须在本地运行，请确保已安装 Python 2.7，然后安装依赖：\n\n```bash\npip install tensorflow==1.1.0 pandas tqdm\n```\n\n*注：由于 TensorFlow 1.x 在较新系统上安装困难，此方案可能遇到兼容性问题。*\n\n---\n\n## 基本使用\n\n安装完成后，按照以下步骤启动训练。\n\n### 1. 配置训练参数\n在容器内（或本地项目根目录），编辑配置文件以设定超参数。示例配置文件位于：\n`\u002Fdeep-trading-agent\u002Fcode\u002Fconfig\u002Fconfig.cfg`\n\n您可以使用 `vim` 进行修改：\n```bash\nvim \u002Fdeep-trading-agent\u002Fcode\u002Fconfig\u002Fconfig.cfg\n```\n主要配置项包括历史长度（默认过去 3 小时\u002F180 分钟）、学习率、批次大小等。\n\n### 2. 启动训练\n运行主程序开始训练代理：\n```bash\npython \u002Fdeep-trading-agent\u002Fcode\u002Fmain.py\n```\n\n程序将执行以下流程：\n- 读取预处理好的比特币分钟级数据。\n- 构建状态表示（包含收盘价、最高价、最低价及交易量）。\n- 利用 Deep Q-Learning 算法进行训练，最大化累积奖励。\n\n### 3. 监控训练过程\n训练支持通过 **TensorBoard** 进行可视化监控。\n\n在容器内的另一个终端窗口（或使用 `screen` 新建会话）运行：\n```bash\ntensorboard --logdir=\u002Fpath\u002Fto\u002Flogs --host=0.0.0.0\n```\n*(注：具体 log 路径请在 config.cfg 中确认)*\n\n然后在宿主机的浏览器中访问：\n`http:\u002F\u002Flocalhost:6006`\n\n您将看到损失函数变化、奖励趋势等实时图表。\n\n---\n\n**数据来源说明**：\n默认数据集是通过采样 Coinbase 交易所的交易记录生成的分钟级比特币价格序列。如需更换数据集或了解详细的预处理逻辑（如缺失值处理），请参考项目 Wiki 或 `assets\u002Fdataset` 目录。","某量化交易团队正试图构建一套针对比特币的自动化高频策略，以应对市场剧烈的分钟级波动。\n\n### 没有 deep-trading-agent 时\n- 依赖人工经验或简单的均线指标制定规则，难以捕捉非线性的市场微观结构变化，导致在震荡市中频繁止损。\n- 缺乏系统的强化学习框架，无法让模型通过历史交互自我进化，策略迭代周期长达数周且效果不稳定。\n- 数据预处理繁琐，需手动编写脚本清洗开盘价、最高价、最低价及成交量等多维特征，容易引入人为偏差。\n- 训练过程不透明，缺少可视化的监控手段，难以判断模型是否收敛或出现过度拟合，调试成本极高。\n\n### 使用 deep-trading-agent 后\n- 基于深度强化学习（DeepSense 网络）自动探索最优交易动作，能敏锐识别复杂的市场形态，显著提升在波动行情中的胜率。\n- 内置完整的训练流水线，利用历史交易所数据自动生成分钟级数据集，模型可通过不断试错快速优化 Q 函数近似值。\n- 自动整合收盘价、极值及交易量作为多通道输入，并标准化价格张量，确保状态表示更全面且计算更高效。\n- 原生支持 Tensorboard 实时监控训练日志与奖励曲线，开发人员可直观调整配置参数，将策略验证周期缩短至数小时。\n\ndeep-trading-agent 通过将前沿的深度强化学习算法工程化，帮助交易者从“凭感觉博弈”转型为“数据驱动的智能决策”，大幅降低了比特币量化策略的研发门槛与风险。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsamre12_deep-trading-agent_0c4575a9.png","samre12","Kartikay Garg","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsamre12_83290880.png","Major in Mathematics and Computing ","Graviton Research Capital","Gurgaon, India","kartikay123@gmail.com",null,"https:\u002F\u002Fsamre12.github.io","https:\u002F\u002Fgithub.com\u002Fsamre12",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",98.4,{"name":88,"color":89,"percentage":90},"Shell","#89e051",1.6,796,206,"2026-04-10T23:08:47","MIT","Linux","未说明",{"notes":98,"python":99,"dependencies":100},"该项目基于较旧的 Python 2.7 和 TensorFlow 1.1.0 版本开发。官方推荐使用 Docker 容器运行以简化环境配置（包含 Ubuntu 虚拟机设置脚本）。训练数据为比特币分钟级价格序列，支持通过 Tensorboard 监控训练过程。","2.7",[101,102,103],"tensorflow==1.1.0","pandas","tqdm",[13],[106,107,108,109,110,111,112,113],"deep-reinforcement-learning","deep-q-network","bitcoin","deep-sense","trading","artificial-intelligence","agent","recurrent-neural-networks","2026-03-27T02:49:30.150509","2026-04-16T10:48:54.187463",[117,122,127,132,137,142,147,152],{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},35786,"为什么运行脚本时计算时间长达 250 小时？如何优化性能或使用 GPU？","目前模型仍需调整超参数并确定最合适的奖励函数。当前模型通常在 2-3 小时内收敛到稳定的奖励值（尽管接近 0）。若需使用 GPU 运行 TensorFlow 代码，请确保正确配置 TensorFlow 的 GPU 支持。维护者指出仍有工作待完成以优化性能。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F18",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},35787,"遇到 'ERROR: No section: global' 错误，但配置文件中确实包含 [global] 部分，如何解决？","该问题通常由配置文件路径不正确引起。请检查是否提供了正确的绝对路径或相对路径。有用户反馈修正 config.cfg 文件的路径后解决了问题。如果问题依旧，可能是正则表达式包（re）或其他环境因素导致，建议仔细核对路径设置。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F9",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},35788,"历史数据集与实时 API 请求之间的价格为何存在巨大差异？","这种差异通常源于数据源不同或时间戳不匹配。Kaggle 数据集与 CryptoCompare API 的数据来源和更新频率不同，可能导致同一时间点的价格显著不同。请确保对比的是相同时间戳且来自同一数据源的价格数据，并注意数据预处理的一致性。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F1",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},35789,"项目为何使用 Python 2.7？如何迁移到 Python 3？","项目最初基于 Python 2.7 开发，但主要依赖的 numpy 和 tensorflow 在 Python 2 和 3 中 API 相似。用户可以通过命令行运行 `2to3 *\u002F*.py -W` 自动将语法升级为 Python 3。维护者欢迎提交 Python 3 版本的 Pull Request。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F11",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},35790,"运行 main.py 时出现 'TypeError: unhashable type: numpy.ndarray' 错误，如何解决？","该错误源于网络训练问题导致动作的平均 Q 值收敛到 0。维护者已修复此问题，请克隆仓库的最新版本即可解决。更新后请重新运行训练，通常可在 50,000 步内完成收敛。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F3",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},35791,"训练完成后，如何在另一组数据上测试代理（agent）？","确保测试时使用与训练相同的环境类型和参数。目前主分支未专门提供测试模块，但开发者分支使用了基于 Gym 的环境（samre12\u002Fgym-cryptotrading），可用于测试当前仓库训练出的代理。请参考该 Gym 环境进行部署测试。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F19",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},35792,"在 Docker 容器中运行 preprocess.py 时被 'killed'（退出码 137），如何解决？","退出码 137 通常表示内存不足导致进程被杀死。在 Mac 上，可通过点击任务栏的 Docker 鲸鱼图标，增加 Docker 的最大内存限制（默认为 2GB）。也可尝试直接使用维护者提供的预构建 Docker 镜像，避免自行构建时出现资源问题。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F15",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},35793,"运行时提示 'ModuleNotFoundError: No module named ConfigParser'，如何解决？","该错误是因为项目基于 Python 2.7 开发，而 'ConfigParser' 是 Python 2 的模块。在 Python 3 中应使用 'configparser'（小写）。解决方案是升级项目到 Python 3（参考 2to3 工具），或在 Python 2 环境中运行。建议迁移至 Python 3 以获得更好支持。","https:\u002F\u002Fgithub.com\u002Fsamre12\u002Fdeep-trading-agent\u002Fissues\u002F4",[]]