Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,11 @@ cython_debug/
**/*.csv
**/*.jpg

benchmarking/

# Models
**/*.keras
**/*.pt
**/*.csv

benchmarking/
370 changes: 370 additions & 0 deletions BLOG.md

Large diffs are not rendered by default.

Binary file added assets/google_trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tfvspt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/train_data.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"pydantic >= 2.10.6",
"torchinfo >= 1.8.0",
"stocaching >= 0.2.0",
"tensorflow >= 2.19.0",
"tensorflow[and-cuda] >= 2.19.0",
"matplotlib >= 3.10.1",
"torchvision >= 0.21.0",
]
Expand Down
2 changes: 0 additions & 2 deletions tfvspt/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Benchmarking Base."""

import logging

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 2 additions & 2 deletions tfvspt/pt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def train(self) -> None:

# save model
st = time.time()
torch.jit.script(model).save(str(self.config.output / "cifar100.pt"))
torch.jit.script(model).save(str(self.config.output / "last.pt"))
self._log_stats("model_saving_time", time.time() - st)

def eval(self) -> dict:
Expand All @@ -202,7 +202,7 @@ def eval(self) -> dict:

# load model
st = time.time()
model = torch.jit.load(str(self.config.output / "cifar100.pt"))
model = torch.jit.load(str(self.config.output / "last.pt"))
self._log_stats("model_loading_time", time.time() - st)

# evaluate
Expand Down
6 changes: 3 additions & 3 deletions tfvspt/tf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def plot_images(self, dataloader, name: str) -> None:
def get_callbacks(self) -> list:
# train history logger
csv_logger = tf.keras.callbacks.CSVLogger(str(self.config.output /
'cifar100_training.csv'),
'history.csv'),
separator=",",
append=False)
return [csv_logger]
Expand Down Expand Up @@ -97,7 +97,7 @@ def train(self) -> None:

# save model
st = time.time()
model.save(str(self.config.output / "cifar100.keras"))
model.save(str(self.config.output / "last.keras"))
self._log_stats("model_saving_time", time.time() - st)

def eval(self) -> dict:
Expand All @@ -107,7 +107,7 @@ def eval(self) -> dict:
# load model
st = time.time()
model = tf.keras.models.load_model(
str(self.config.output / "cifar100.keras"))
str(self.config.output / "last.keras"))
self._log_stats("model_loading_time", time.time() - st)

# evaluate
Expand Down