-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bcc1bd
commit 7332dc2
Showing
4 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# What is this | ||
|
||
this is a single file simulation representing a common case of usage of neetbox. Edit `neetbox.toml` and run `test.py` performs a general test on some neetbox behaviors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
pytest.skip(allow_module_level=True) | ||
|
||
from random import random | ||
from time import sleep | ||
|
||
from neetbox.integrations.environment import hardware, platform | ||
from neetbox.logging import logger | ||
from neetbox.pipeline import listen, watch | ||
|
||
|
||
@watch("train", initiative=True) | ||
def train(epoch): | ||
loss, acc = random(), random() | ||
return {"loss": loss, "acc": acc} | ||
|
||
|
||
@listen("train") | ||
def print_to_console(metrix): | ||
logger.log(f"metrix from train: {metrix}") | ||
|
||
|
||
for i in range(99999): | ||
sleep(1) | ||
train(i) |