Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#869 Add DagsHub Logger to Super Gradients

Merged
Ghost merged 1 commits into Deci-AI:master from timho102003:dagshub_logger
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  1. from typing import List, Union
  2. def average(samples: List[float], time_diff: float) -> Union[float, None]:
  3. """Average a list of values, return None if empty list"""
  4. return sum(samples) / len(samples) if samples else None
  5. def delta_per_s(samples: List[float], time_diff: float) -> Union[float, None]:
  6. """Compute the difference per second (ex. megabytes per second), return None if empty list"""
  7. return (samples[-1] - samples[0]) / time_diff if samples else None
  8. def bytes_to_megabytes(b: float) -> float:
  9. """Convert bytes to megabytes"""
  10. BYTES_PER_MEGABYTE = 1024**2
  11. return b / BYTES_PER_MEGABYTE
Discard
Tip!

Press p or to see the previous file or, n or to see the next file