MCPcopy Create free account
hub / github.com/mlco2/codecarbon / train_model

Function train_model

examples/logging_to_google_cloud.py:11–21  ·  view source on GitHub ↗

This function will do nothing during (occurrence * delay) seconds. The Code Carbon API will be called every (measure_power_secs * api_call_interval) seconds.

(epochs: int)

Source from the content-addressed store, hash-verified

9
10
11def train_model(epochs: int):
12 """
13 This function will do nothing during (occurrence * delay) seconds.
14 The Code Carbon API will be called every (measure_power_secs * api_call_interval)
15 seconds.
16 """
17 occurrence = epochs # 60 * 24
18 delay = 30 # Seconds
19 for i in range(occurrence):
20 print(f"{occurrence * delay - i * delay} seconds before ending script...")
21 time.sleep(delay)
22
23
24if __name__ == "__main__":

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…