forked from AITech/aitech-ium
07. Sacred
This commit is contained in:
parent
72e50d9fb6
commit
f3864d18b4
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"recipient": "samotności",
|
||||
"greeting": "Żegnaj"
|
||||
}
|
|
@ -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
|
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
After Width: | Height: | Size: 107 KiB |
|
@ -0,0 +1,7 @@
|
|||
from sacred import Experiment
|
||||
|
||||
ex = Experiment()
|
||||
|
||||
@ex.automain
|
||||
def my_main():
|
||||
print('Witaj świecie!')
|
|
@ -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