aboutsummaryrefslogtreecommitdiff
path: root/src/graph.py
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-06-08 18:45:09 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-06-08 18:45:09 +0530
commit3bc24933f4128e76ccbd6e37155ff6cccb20a182 (patch)
treef4d4b01bb0a025b2114958ae778de7cc1275690c /src/graph.py
parentfd9a31f983ef2cfd5c1a89be25fa9e262082737b (diff)
Automate backward propagation
Diffstat (limited to 'src/graph.py')
-rw-r--r--src/graph.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/graph.py b/src/graph.py
index 6c8ab53..6bebb06 100644
--- a/src/graph.py
+++ b/src/graph.py
@@ -1,8 +1,5 @@
import tkinter as tk
-
from graphviz import Digraph
-import matplotlib.pyplot as plt
-import matplotlib.image as mpimg
from .scalar import Scalar
@@ -33,7 +30,7 @@ class Graph:
# Create a node in the graph
self.dot.node(
name=uid,
- label=f"{node.label} | {node.data} | grad: {node.grad}",
+ label=f"{node.label} | {node.data:.4f} | grad: {node.grad:.4f}",
shape='record'
)