transparentai.sustainable
¶
This submodule contains functions in the transparentai.sustainable submodule.
Sustainable submodule¶
-
transparentai.sustainable.energy_usage.
evaluate_kWh
(func, *args, verbose=False)[source]¶ Using energyusage.evaluate function returns the result of the function and the effective emissions of the function (in kWh)
With verbose = True you can see the report with details.
If you want a pdf please use the following:
>>> energyusage.evaluate(func, *args, pdf=True)
From energyusage package.
Parameters: - func – User’s function
- verbose (bool (default False)) – Whether it shows details or not
Returns: - float – effective emissions of the function in kWh
- any – function’s return
-
transparentai.sustainable.sustainable.
emissions
(process_kwh, breakdown, location)[source]¶ Calculates the CO2 emitted by the program based on the location
Parameters: Returns: emission in kilograms of CO2 emitted
Return type: Raises: ValueError: – Process wattage must be greater than 0.
-
transparentai.sustainable.sustainable.
energy_mix
(location)[source]¶ Gets the energy mix information for a specific location
Parameters: Returns: percentages of each energy type
Return type: Raises: ValueError: – location must be a valid countries
-
transparentai.sustainable.sustainable.
estimate_co2
(hours, location, watts=250, powerLoss=0.8)[source]¶ Returns co2 consumption in kg CO2
To find out the wattage of the machine used for training, I recommend you use this website: Newegg’s Power Supply Calculator .
Based on this website: Power Management Statistics we can estimate an average wattage to be 250 Watts, but be carefull, it’s only an estimation. So if you’re using a computer with GPU or others components I recommend you use the first website that allows you to compute your wattage.
Parameters: Returns: emission in kilograms of CO2 emitted
Return type: