Experiment 03 — feed-forward network with plant-watering decision logic
Experiment date: July 31, 2026
Distribution: Sensory 0.1.1 for Windows
Question
Can a small Cognia feed-forward network turn plant and weather state into a practical recommendation while keeping learned estimation separate from hard safety rules?
This is not an agronomic model or real-world watering guidance. A synthetic teacher produces the dataset so the experiment remains local, reproducible, and easy to understand.
Input and output
The network receives nine values in this order:
- soil moisture,
- air temperature,
- relative air humidity,
- sunlight intensity,
- rain probability,
- hours since the last watering,
- the
cactusflag, - the
herbflag, - the
tomatoflag.
The client and generator linearly map the first six physical values to [-1, 1].
Plant type is one-hot encoded. The three output neurons represent:
NO_WATER | LIGHT_WATER | DEEP_WATER
Architecture
9 sensors ──→ 9 fixed nonlinear features ──→ 3 decisions
└──────────────── raw skip path ──────→┘
The fixed layer applies a feed-forward tanh transform and its weights are not
trained. Softmax training updates only edges entering the final decision area.
The skip path preserves raw information for the linear readout.
This limitation is deliberate and important: Cognia is not an autodiff framework, and the current runtime does not provide general backpropagation or deep credit assignment. The example therefore makes no end-to-end deep-training claim.
Synthetic teacher
The generator computes a continuous water-demand score. Soil dryness has the largest weight; heat, dry air, sunlight, and plant type make smaller contributions. Forecast rain reduces demand. Two thresholds map the score to three classes.
Generation uses seed 103 and rejection sampling until it has exactly 200
examples of each class. Balancing prevents the trivial strategy of always
choosing the most common action. Time since watering is available as context,
but the hard cooldown remains in the safety layer.
Post-network decision policy
The client converts the three scores to probabilities, selects their maximum, and then applies:
soil moisture >= 75% → NO_WATER
time since watering < 6 h → NO_WATER
highest confidence < 55% → WAIT_AND_RECHECK
otherwise → network recommendation
This separates a statistical recommendation from protective invariants. A model error cannot bypass the ban on watering wet or just-watered soil.
Reproduction and measured result
The commands are in README-en.md. With the included dataset, seed 103, and
5000 iterations, this distribution build measured:
accuracy: 403/600 (67.2%)
MSE: 0.4355
This is training accuracy, not a generalization estimate. The result is reported without embellishment: the final local readout captures the main trend, but compound multilayer classification without deep credit assignment remains unsolved. A serious evaluation would generate a separate test set with another seed.
Verified illustrative scenarios after this training run:
| Situation | Result |
|---|---|
| dry tomato, hot and sunny, little rain | DEEP_WATER (60.8%) |
| cactus, medium moisture, likely rain | NO_WATER (56.8%) |
| already wet soil | safety override to NO_WATER |
| tomato watered two hours ago | safety override to NO_WATER |
What the experiment represents
- mapping familiar physical units into neural input;
- a real feed-forward layered path with no recurrence;
- a three-class softmax decision;
- REST deployment of the trained network;
- safe composition of a probabilistic model and deterministic policy;
- a transparent demonstration of Cognia's current deeper-learning limit.