Make documentation standalone and generalize examples
This commit is contained in:
+33
-34
@@ -1,60 +1,59 @@
|
||||
# Fluksio
|
||||
|
||||
Fluksio is a node-based automation software that brings trust and reliability to your flow.
|
||||
It just works and looks good.
|
||||
Get started by running
|
||||
Turn Python functions into connected nodes, run experiments, and keep their
|
||||
metrics and artifacts together. Start an engine with Python 3.12 or newer
|
||||
on Linux or macOS:
|
||||
|
||||
```sh
|
||||
pip install fluksio
|
||||
fluksio serve
|
||||
```
|
||||
|
||||
and you're ready to go.
|
||||
The first start prints an admin password and opens a terminal dashboard.
|
||||
For a browser dashboard, connect the instance to the optional
|
||||
[portal](https://docs.fluksio.com/interface/portal/).
|
||||
|
||||
## For data science
|
||||
|
||||
You can turn your existing data science project into a flow by decorating your functions with `@node` ...
|
||||
Save this small experiment as `study.py`. No dataset or GPU needed:
|
||||
|
||||
```python
|
||||
# myresearch/train.py
|
||||
import fluksio
|
||||
from fluksio import Port, node
|
||||
import math
|
||||
|
||||
from fluksio import Flow, Port, node
|
||||
|
||||
@node(
|
||||
requires=["dataset", Port("lr", "float")],
|
||||
provides=[Port("loss", "float", stream=True), Port("weights", "artifact")],
|
||||
worker="gpu", worker_policy="prefer",
|
||||
requires=[Port("lr", "float")],
|
||||
provides=[Port("loss", "float", stream=True), Port("final_loss", "float")],
|
||||
)
|
||||
def fit(dataset, lr, epochs=25):
|
||||
def fit(lr, epochs=25):
|
||||
for epoch in range(epochs):
|
||||
loss = step(...)
|
||||
yield {"loss": loss} # published as it happens, kept as a series
|
||||
return {"weights": fluksio.save_artifact("weights.pt")}
|
||||
loss = math.exp(-lr * (epoch + 1))
|
||||
yield {"loss": loss}
|
||||
return {"final_loss": loss}
|
||||
|
||||
|
||||
train = Flow(
|
||||
"train",
|
||||
nodes=[fit],
|
||||
inputs=[Port("lr", "float", initial=0.01)],
|
||||
outputs=["final_loss"],
|
||||
)
|
||||
```
|
||||
|
||||
... and passing them to a `Flow`:
|
||||
|
||||
```python
|
||||
# myresearch/pipeline.py
|
||||
from fluksio import Flow, Port
|
||||
from myresearch.data import prepare
|
||||
from myresearch.evaluate import evaluate
|
||||
from myresearch.train import fit
|
||||
|
||||
train = Flow("train", nodes=[prepare, fit, evaluate],
|
||||
inputs=[Port("lr", "float", initial=0.01)], outputs=["score"])
|
||||
```
|
||||
|
||||
Fluksio will automatically infer the order of nodes based on the inputs and outputs you defined.
|
||||
When everything is set, you can launch your first run as follows:
|
||||
Matching message names connect the nodes and determine their order. After
|
||||
syncing the project, start a run:
|
||||
|
||||
```sh
|
||||
fluksio sync study
|
||||
fluksio run train --lr 0.05 --wait
|
||||
```
|
||||
|
||||
Checkout our [documentation](https://docs.fluksio.com/getting-started/data-science/) for more infos.
|
||||
Each yield records a point on the loss curve. Replace the toy calculation
|
||||
with your own training code when you're ready. For artifacts and comparisons, try the
|
||||
[data science guide](https://docs.fluksio.com/getting-started/data-science/).
|
||||
|
||||
## Some other features
|
||||
## More to explore
|
||||
|
||||
- **Flows**: typed messages between nodes, wired by name, edited on a canvas
|
||||
or declared in code. Every change is a commit in a git repository you own.
|
||||
@@ -65,8 +64,8 @@ Checkout our [documentation](https://docs.fluksio.com/getting-started/data-scien
|
||||
- **Remote workers**: `pip install fluksio-worker` on the GPU box; it dials
|
||||
*out* over one websocket, so nothing there has to be reachable.
|
||||
|
||||
Fluksio can also be used for facility automation.
|
||||
Visit us on [fluksio.com](https://fluksio.com) or go straight to our [documentation](https://docs.fluksio.com).
|
||||
For sensors, devices and live automation, try the
|
||||
[facility automation guide](https://docs.fluksio.com/getting-started/facility-automation/).
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user