A simple PyTorch CNN package
Project description
Gói CNN Module
Tổng quan
my_cnn_package là một gói Python nhẹ và linh hoạt được xây dựng trên nền tảng PyTorch, giúp bạn dễ dàng tạo, huấn luyện và đánh giá các mô hình Mạng Nơ-ron Tích chập (CNN). Gói này được thiết kế để đơn giản hóa quy trình làm việc với CNN, hỗ trợ cả dữ liệu chuẩn (như MNIST) và dữ liệu tùy chỉnh của người dùng. Nó rất phù hợp cho người mới học, các nhà nghiên cứu, hoặc nhà phát triển muốn nhanh chóng tạo nguyên mẫu và triển khai mô hình học sâu vào thực tế.
Tính năng nổi bật
- Mô hình CNN linh hoạt: Bạn có thể dễ dàng tùy chỉnh kiến trúc của CNN theo nhu cầu.
- Hỗ trợ dữ liệu tích hợp: Bao gồm các tiện ích để làm việc với các tập dữ liệu phổ biến như MNIST hoặc dữ liệu do người dùng cung cấp.
- Tiện ích huấn luyện: Vòng lặp huấn luyện được tối ưu hóa, hỗ trợ GPU nếu có.
- Ví dụ trực quan: Một ví dụ hoàn chỉnh được tích hợp để giúp người dùng hiểu nhanh quy trình.
- Mở rộng dễ dàng: Thiết kế để dễ dàng tích hợp vào các dự án học sâu khác sử dụng PyTorch.
Cài đặt
Gói này đã được đăng tải trên PyPI, bạn có thể cài đặt nhanh chóng bằng lệnh:
pip install my-cnn-package
--
Chạy code:
import torch
from model import SimpleCNN
from trainer import Trainer
from data_utils import get_data_loaders
def main():
# Load data
train_loader, val_loader = get_data_loaders(your data dir)
# Initialize model
model = SimpleCNN()
# Check for CUDA
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
# Train and evaluate
trainer = Trainer(model)
trainer.train(train_loader, epochs=5, lr=0.001)
trainer.evaluate(val_loader)
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file my_cnn_package-0.2.0.tar.gz.
File metadata
- Download URL: my_cnn_package-0.2.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0abdca94fc1b4e26c6e735f859671d5ce99336372eb5b3abf81148c747888b
|
|
| MD5 |
6a86b61b3574a5d9b6320257a2271713
|
|
| BLAKE2b-256 |
c0f5460ea901598a77dbdc1c99baebf32387b3c2e82033eb274cc12bdcaeb4fd
|
File details
Details for the file my_cnn_package-0.2.0-py3-none-any.whl.
File metadata
- Download URL: my_cnn_package-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12f545105f7538ab22b6f422d256b9a9cab8323d5c4d80ef2cbfec66be8cd0ef
|
|
| MD5 |
a0c8a392a5f11475dce88ade9d6e6d22
|
|
| BLAKE2b-256 |
fea6a0b8c6d3a9404fd5c46c0e3249059991a7a9a9928b4a702893c03b946639
|