forked from tzietkiewicz/aitech-ium
07. Sacred
This commit is contained in:
parent
72e50d9fb6
commit
f3864d18b4
1442
IUM_07.Sacred.ipynb
Normal file
1442
IUM_07.Sacred.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
4
IUM_07/config.json
Normal file
4
IUM_07/config.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"recipient": "samotności",
|
||||||
|
"greeting": "Żegnaj"
|
||||||
|
}
|
19
IUM_07/file_observer.py
Normal file
19
IUM_07/file_observer.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
from sacred.observers import FileStorageObserver
|
||||||
|
from sacred import Experiment
|
||||||
|
|
||||||
|
ex = Experiment("file_observer")
|
||||||
|
|
||||||
|
ex.observers.append(FileStorageObserver('my_runs'))
|
||||||
|
|
||||||
|
@ex.config
|
||||||
|
def my_config():
|
||||||
|
recipient = "Świecie"
|
||||||
|
greeting = "Witaj"
|
||||||
|
|
||||||
|
@ex.capture
|
||||||
|
def prepare_message(recipient, greeting):
|
||||||
|
return "{0} {1}!".format(greeting, recipient)
|
||||||
|
|
||||||
|
@ex.automain
|
||||||
|
def my_main(recipient, greeting):
|
||||||
|
print(prepare_message()) ## Nie musimy przekazywać wartości
|
BIN
IUM_07/metrics.png
Normal file
BIN
IUM_07/metrics.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
BIN
IUM_07/omniboard.png
Normal file
BIN
IUM_07/omniboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 107 KiB |
7
IUM_07/sacred_hello.py
Normal file
7
IUM_07/sacred_hello.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
from sacred import Experiment
|
||||||
|
|
||||||
|
ex = Experiment()
|
||||||
|
|
||||||
|
@ex.automain
|
||||||
|
def my_main():
|
||||||
|
print('Witaj świecie!')
|
13
IUM_07/sacred_scopes.py
Normal file
13
IUM_07/sacred_scopes.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from sacred import Experiment
|
||||||
|
|
||||||
|
ex = Experiment()
|
||||||
|
|
||||||
|
@ex.config
|
||||||
|
def my_config():
|
||||||
|
recipient = "Świecie"
|
||||||
|
greeting = "Witaj"
|
||||||
|
message = "{0} {1}!".format(greeting, recipient)
|
||||||
|
|
||||||
|
@ex.automain
|
||||||
|
def my_main(message):
|
||||||
|
print(message)
|
Loading…
Reference in New Issue
Block a user