Skip to main content

深度学习框架(Deep Learning Framework)

Project description

深度学习框架 V0.2.0

一、安装及使用

1、安装:pip install start-zero

二、未来规划

1、持续优化代码并修正BUG
2、增加函数、层、模型、优化器
3、增加GPU支持

三、框架说明

1、主要特点
自动微分、运行时动态图、高阶求导(反向传播的反向传播)、函数、层、模型、优化器
2、目前支持51个函数,参见函数列表
3、基于谷歌论文《Attention Is All You Need》实现了具有编码器和解码器的Transformer模型,训练调用示例:

def train():
    lr = 0.001  # 学习率
    epoch = 500  # 迭代次数
    batch_size = 5  # 批量处理
    # 加载模型TransformerV1
    model = TransformerV1(...)
    # 使用优化器Adam并安装模型
    optimizer = Adam(lr).setup(model)
    for i in range(epoch):
        # 调用模型的正向传播
        x_grad = model(...)
        # 计算损失值
        loss = ...
        # 清空中间梯度
        model.clear_tensors()
        # 反向传播
        loss.backward()
        # 参数更新
        optimizer.update()
        if i % 10 == 0:
            accuracy_out = ...
            print("准确率:" + str(accuracy_out) + "%,损失值:" + str(loss))
    # 保存模型
    model.save_parameters('transformer_v1_model')

四、发布到PyPI

1、登录PyPI官网完成账号注册和安全认证
2、安装插件(如:E:\pyhton\python.exe -m pip install --upgrade pip setuptools wheel和E:\pyhton\python.exe -m pip install twine)
3、生成压缩包(python setup.py sdist)
4、上传压缩包(如:E:\pyhton\python.exe -m twine upload dist/*)
注:完成2FA认证后,username是:token,password是:生成的token
5、安装和卸载(pip install start-zero、pip uninstall start-zero)
注:指定版本如:pip install start-zero==1.0.0,也可以<或<=等

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

start_zero-0.2.0.tar.gz (39.7 kB view details)

Uploaded Source

File details

Details for the file start_zero-0.2.0.tar.gz.

File metadata

  • Download URL: start_zero-0.2.0.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for start_zero-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4878ca498c6e3cce0a5364a16cc10c94a92c532d851b8a896e43b0f21cfcab55
MD5 c287f0eabf3a73e319f4d1a884fba180
BLAKE2b-256 8001ee334367bcb035d13fbd135476a0a2566b71e79577a86510ca9b27b0ba62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page