semvec/pypi-packages huggingface dataset:
quad-torch 0.4.5
An implementation of PSGD-QUAD optimizer in PyTorch.
Requires Python: >=3.10
Keywords: python, machine learning, optimization, pytorch

# PSGD-QUAD

`pip install quad-torch`

An implementation of PSGD-QUAD for PyTorch.

```python
import torch
from quad_torch import QUAD

model = torch.nn.Linear(10, 10)
optimizer = QUAD(
    model.parameters(),
    lr=0.001,
    lr_style="adam",
    momentum=0.95,
    weight_decay=0.1,
    max_size_dense=8192,
    max_skew_dense=1.0,
    preconditioner_lr=0.7,
    noise_scale=1e-9,
    dtype=torch.bfloat16,
)
```

Couple notes:

- `lr_style="adam"` is the default and scales the update to match adam's behavior LR-wise and weight decay-wise.
- `dtype=torch.bfloat16` should be fine for most problems, but if a problem is particularly sensitive then you can try `None` to default to gradient dtypes or `torch.float32` to force f32 precision.


## Resources

Xi-Lin Li's repo: https://github.com/lixilinx/psgd_torch

PSGD papers and resources listed from Xi-Lin's repo

1) Xi-Lin Li. Preconditioned stochastic gradient descent, [arXiv:1512.04202](https://arxiv.org/abs/1512.04202), 2015. (General ideas of PSGD, preconditioner fitting losses and Kronecker product preconditioners.)
2) Xi-Lin Li. Preconditioner on matrix Lie group for SGD, [arXiv:1809.10232](https://arxiv.org/abs/1809.10232), 2018. (Focus on preconditioners with the affine Lie group.)
3) Xi-Lin Li. Black box Lie group preconditioners for SGD, [arXiv:2211.04422](https://arxiv.org/abs/2211.04422), 2022. (Mainly about the LRA preconditioner. See [these supplementary materials](https://drive.google.com/file/d/1CTNx1q67_py87jn-0OI-vSLcsM1K7VsM/view) for detailed math derivations.)
4) Xi-Lin Li. Stochastic Hessian fittings on Lie groups, [arXiv:2402.11858](https://arxiv.org/abs/2402.11858), 2024. (Some theoretical works on the efficiency of PSGD. The Hessian fitting problem is shown to be strongly convex on set ${\rm GL}(n, \mathbb{R})/R_{\rm polar}$.)
5) Omead Pooladzandi, Xi-Lin Li. Curvature-informed SGD via general purpose Lie-group preconditioners, [arXiv:2402.04553](https://arxiv.org/abs/2402.04553), 2024. (Plenty of benchmark results and analyses for PSGD vs. other optimizers.)


## License

[![CC BY 4.0][cc-by-image]][cc-by]

This work is licensed under a [Creative Commons Attribution 4.0 International License][cc-by].

2024 Evan Walters, Omead Pooladzandi, Xi-Lin Li


[cc-by]: http://creativecommons.org/licenses/by/4.0/
[cc-by-image]: https://licensebuttons.net/l/by/4.0/88x31.png
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
mcp-server-tke 0.0.5
MCP Server for Tencent Cloud TKE
Requires Python: >=3.10

# 腾讯云 TKE MCP Server（中文版）

腾讯云容器服务(TKE) Model Context Protocol (MCP) 服务器，提供标准化的TKE集群管理接口。

## 功能特性
- **集群生命周期管理**：创建、删除

## 工具列表（Tools）

### 集群生命周期
| 工具名称 | 功能说明 |
|---|---|
| `CreateCluster` | 创建集群 |
| `DeleteCluster` | 删除集群 |
| `ModifyClusterAttribute` | 修改集群属性 |
| `DescribeClusters` | 查询集群列表 |

## 快速开始
### 1. 准备腾讯云凭证
- 登录 [腾讯云控制台](https://console.cloud.tencent.com/)，进入「访问管理」→「访问密钥」获取 `SecretId` 与 `SecretKey`

### 2. 配置环境变量
```bash
export TENCENTCLOUD_SECRET_ID=你的SecretId
export TENCENTCLOUD_SECRET_KEY=你的SecretKey
```

### 3. Claude Desktop 配置
编辑 `claude_desktop_config.json`（Mac 默认路径 `~/Library/Application Support/Claude/claude_desktop_config.json`），加入：

```json
{
  "mcpServers": {
    "tencent-tke": {
      "command": "uv",
      "args": ["run", "mcp-server-tke"],
      "env": {
        "TENCENTCLOUD_SECRET_ID": "你的SecretId",
        "TENCENTCLOUD_SECRET_KEY": "你的SecretKey",
      }
    }
  }
}
```

### 4. 安装
```bash
pip install mcp-server-tke
```

### 5. 贡献
#### 通过云API转化成MCP API文件
1. 通过云API导出OpenAPI格式的json文件，放到`openapi/`目录下。
2. 使用 `openapi-to-mcp-tools` 工具将OpenAPI json文件转换为MCP API yaml文件，放置在 `./mcpapi/` 目录下。
```bash
# 安装工具
go install github.com/higress-group/openapi-to-mcpserver/cmd/openapi-to-mcp@latest

# 转换示例
openapi-to-mcp --input openapi/tke_2018-05-25_DeleteCluster.json --output mcpapi/2018-05-25_DeleteCluster.yaml
```
3. 为了让AI有更好的体验，适当的删除`2018-05-25_DeleteCluster.yaml`不需要的API参数，并补充必要的描述信息。
4. 启动 `mcp-server-tke`，程序自动加载文件，即可通过Claude调用新增的MCP工具。

## 许可证
MIT License，详见 LICENSE 文件。