Metadata-Version: 2.1
Name: qdvis
Version: 0.1.2
Summary: qdvis: Quick data visualizer.
Home-page: https://github.com/ta-ke-inf/qdvis/tree/main
Download-URL: https://github.com/ta-ke-inf/qdvis/tree/main
Author: Takeguchi
Author-email: hirotake.stu@gmail.com
Maintainer: Takeguchi
Maintainer-email: hirotake.stu@gmail.com
License: MIT
Keywords: visualization ml
Description-Content-Type: text/markdown
License-File: LICENSE

# qdvis (Quick Data Visualizer)
This is a tool to easily visualize the logs when long time processing is required by simply starting up a local server.
## Installation
```
pip install qdvis
```
## Usage
1. Exmaple of code. Let the log be added to the writer object anywhere in the code (e.g., loop).
```python
from qdvis.writer import LogWriter

writer = LogWriter()

num_epochs = 10
for epoch in range(num_epochs):
    for inputs, targets in data_loader:
        outputs = model(inputs)
        loss = criterion(outputs, targets)
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
    
    print(f"Epoch {epoch+1}/{num_epochs}, Loss: {loss.item()}")

    writer.add_scalar(x_value=epoch, y_value=loss.item())
```
2. You can start a terminal and launch a local server for visualization with the `qdvis` command.
```
qdvis --logpath ./logs/log.json --port 8000
```
- --logpath:  path for log file.
- --port: port of local server.


## Methods
gpu utilization can be added to the log
```
add_scaler(x_value, y_value)
```
Parameters
- x_value(float): x scaler value of 2D chart.
- y_value(float): y scaler value of 2D chart.




2D chart can be added to the log
```
add_gpu_status()
```
