Run Torch With A Simple Miner
Project description
Published on pypi
Packaged Using Poetry
Description
TorchMiner is designed to automatic process the training ,evaluating and testing process for PyTorch DeepLearning,with a simple API.
You can access all Functions of MineTorch simply use Miner
.
Quick Start
import TorchMiner
from TorchMiner import Miner
from TorchMiner.plugins.Logger.Jupyter import JupyterLogger, JupyterTqdm
from TorchMiner.plugins.Metrics import MultiClassesClassificationMetric
from TorchMiner.plugins.Recorder import TensorboardDrawer
miner = Miner(
alchemy_directory='/the/route/to/log',
train_dataloader=train_dataloader,
val_dataloader=val_dataloader,
model=model,
loss_func=MSELoss,
optimizer=optimizer,
# or, by passing a function to optimizer, TorchMiner can auto cuda the params of optimizer
# optimizer=lambda x: optim.SGD(x.parameters(), lr=0.01),
experiment="the-name-of-experiment", # Subdistribution in the experimental directory
resume=True, # Whether to automatically load the previous model
eval_epoch=1, # How many rounds are evaluated
persist_epoch=2, # How many rounds are saved once a checkpoint
accumulated_iter=1, # How many times iterates the parameter update after accumulation
in_notebook=True,
amp=True, # Whether to use amp
plugins=[
# Use the plugins to extend the function of miner
JupyterLogger(),
JupyterTqdm(),
# or, you can use the below one to auto enable the above two
# *JupyterEnvironmentAutoEnable(),
# The two above plugins are designed to get better output in Jupyter Enviroment
MultiClassesClassificationMetric(),
# This Plugin can automaticly calculate Accuracy, kappa score and Confusion Matrix in Classification problems.
TensorboardDrawer(input_to_model),
# This Plugin can record the informations generate by training process or by other plugins in Tensorboard.
],
)
# And then, trigger the training process by
miner.train()
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
TorchMiner-0.4.11.tar.gz
(19.1 kB
view details)
Built Distribution
File details
Details for the file TorchMiner-0.4.11.tar.gz
.
File metadata
- Download URL: TorchMiner-0.4.11.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8c0bd642c54c7927ecc50bfc7887d86e303a8249ba6f99c5b302322f0aa2ff4 |
|
MD5 | 99582c051734ffc8384a3c9ef4eaca9c |
|
BLAKE2b-256 | f54f17c407ea4c61ed4cbb4eec6beec918b313b60ecae59e87fa914ed1ce964e |
File details
Details for the file TorchMiner-0.4.11-py3-none-any.whl
.
File metadata
- Download URL: TorchMiner-0.4.11-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f6c63bdf486830d99804e869c1b30ddeabc5d856f975cc98a804308e39a81e |
|
MD5 | 51d1231a357e92c6d583ec0df6e500a8 |
|
BLAKE2b-256 | 1b669786a20ad8183fb7528cae277e6c64860fc01ce55250f6fcfbbfe35a40ba |