From database(PostgreSQL, ...) to PyTorch Dataloader.
Project description
tsdataloader
From database(PostgreSQL, ...) to PyTorch Dataloader.
from tsdataloader import PostgresDataLoader
from tsdataloader import PostgresDataset
dataset = PostgresDataset(
db="your_dbname",
user="your_user",
password="your_password",
host="localhost",
port="5432",
query="SELECT v1,v2 FROM my_table;",
fetch_size=10000,
)
dataloader = PostgresDataLoader(dataset, batch_size=5)
for batch in dataloader:
print(batch)
"""
tensor([[0.3642, 0.4362],
[0.4080, 0.3847],
[0.2716, 0.9373],
[0.4719, 0.7099],
[0.3831, 0.1706]])
tensor([[0.9456, 0.7972],
[0.6847, 0.5980],
[0.2215, 0.2913],
[0.3048, 0.9703],
[0.3780, 0.7710]])
...
"""
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
tsdataloader-0.1.0.tar.gz
(2.2 kB
view details)
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 tsdataloader-0.1.0.tar.gz.
File metadata
- Download URL: tsdataloader-0.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.20.0.post1 CPython/3.10.15 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fb3420290ca5ef21cfe001ab0cb89bd1a7ba5474b670bd7f65e9af089e852b6
|
|
| MD5 |
9c2deecfc017d887557a83f0aa0dba13
|
|
| BLAKE2b-256 |
8035f50abd7a3a50f05cb184aac323373246eccd7a857c88b7e419cd3943d772
|
File details
Details for the file tsdataloader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tsdataloader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.20.0.post1 CPython/3.10.15 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce9d10cc5a39366f10b697b975e4962faaf099e50064246ab910c82a92d27a70
|
|
| MD5 |
9cc0520adba866aec826b26c6dadc7b9
|
|
| BLAKE2b-256 |
39f5813cc5542e2422e57dc4b5b7f1cda71419232d52fdc86fe72a0796264050
|