Skip to content

Commit 2a34028

Browse files
committed
weight learning documentation updated
1 parent f772202 commit 2a34028

2 files changed

+29
-3
lines changed

doc/3_1_weight_learning_examples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Friends(x, y) => (Smokes(x) <=> Smokes(y))
2929
Of course, this does not hold for all smokers, so in Markov logic we can just tack a weight
3030
on to the rule, or, as we do here, learn a weight from training data.
3131

32-
***Training data (training.db)***
32+
### Training data (smoking-train.db)
3333

3434
```lang-none
3535
Friends(Anna, Bob)
@@ -125,7 +125,7 @@ Obs(Yellow, t) => State(Drive, t)
125125
Obs(Yellow, t) => State(Slow, t)
126126
```
127127

128-
*Training data (traffic-train.db):*
128+
### Training data (traffic-train.db)
129129

130130
```lang-none
131131
Obs(Red, 0)

doc/3_2_temporal_weight_learning_examples.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Below we provide examples that demonstrate LoMRF weight learning capabilities in the domain of temporal reasoning.
44

5-
## Activity Recognition ##
5+
## Activity Recognition
66

77
In this example we demonstrate how to perform weight learning for activity recognition, using a small fragment of the first
88
set of the [CAVIAR dataset](http://homepages.inf.ed.ac.uk/rbf/CAVIARDATA1/). We use the same Probabilistic Event Calculus
@@ -60,4 +60,30 @@ Happens(Active_ID0, 170)
6060
Happens(Active_ID1, 170)
6161
//
6262
// ... sequence of facts ...
63+
```
64+
65+
### Weight Learning
66+
67+
The files of this example are the following:
68+
* Knowledge base files:
69+
* Main MLN file in CNF: [theory_cnf.mln](/Examples/Weight_Learning/Activity_Recognition/theory.mln)
70+
* Definitions of moving activity: [definitions/moving.mln](/Examples/Weight_Learning/Activity_Recognition/definitions/moving.mln)
71+
* Definitions of meeting activity: [definitions/meeting.mln](/Examples/Weight_Learning/Activity_Recognition/definitions/meeting.mln)
72+
* Training file for batch learning: [training.db](/Examples/Weight_Learning/Activity_Recognition/training/batch/training.db)
73+
* Training files for online learning: [micro-batches](/Examples/Weight_Learning/Activity_Recognition/training/online/)
74+
75+
Parameters:
76+
* Non-evidence predicates: `HoldsAt/2`
77+
78+
***Max-Margin Learning***
79+
80+
```lang-none
81+
lomrf-wlearn -i theory_cnf.mln -t training.db -o learned.mln -ne HoldsAt/2 -lossAugmented
82+
```
83+
***Online Learning using AdaGrad or CDA***
84+
85+
```lang-none
86+
lomrf-wlearn -alg ADAGRAD -i theory_cnf.mln -t ./training/online -o learned.mln -ne HoldsAt/2
87+
88+
lomrf-wlearn -alg CDA -i theory_cnf.mln -t ./training/online -o learned.mln -ne HoldsAt/2 -lossAugmented
6389
```

0 commit comments

Comments
 (0)