Skip to content

Commit a9d7be1

Browse files
authored
Clarifications in README.
Specifically, about what the compatibility and kernel parameters are, about missing the weights, and some pointers about learning.
1 parent d824b89 commit a9d7be1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The `compat` argument can be any of the following:
109109
- A 1D array, then a `DiagonalCompatibility` is being used.
110110
- A 2D array, then a `MatrixCompatibility` is being used.
111111

112-
Compatibilities are [ways to weight contributions](https://github.com/lucasb-eyer/pydensecrf/issues/8#issuecomment-188478006).
112+
These are label-compatibilites `µ(xi, xj)` whose parameters could possibly be [learned](https://github.com/lucasb-eyer/pydensecrf#learning). For example, they could indicate that mistaking `bird` pixels for `sky` is not as bad as mistaking `cat` for `sky`. (Wrong, old interpretation: <s>[ways to weight contributions](https://github.com/lucasb-eyer/pydensecrf/issues/8#issuecomment-188478006)</s>).
113113

114114
### Kernels
115115

@@ -119,6 +119,10 @@ Possible values for the `kernel` argument are:
119119
- `DIAG_KERNEL` (the default)
120120
- `FULL_KERNEL`
121121

122+
This specifies the kernel's precision-matrix `Λ(m)`, which could possibly be learned.
123+
These indicate correlations between feature types, the default implying no correlation.
124+
Again, this could possiblty be [learned](https://github.com/lucasb-eyer/pydensecrf#learning).
125+
122126
### Normalizations
123127

124128
Possible values for the `normalization` argument are:
@@ -128,6 +132,14 @@ Possible values for the `normalization` argument are:
128132
- `NORMALIZE_AFTER`
129133
- `NORMALIZE_SYMMETRIC` (the default)
130134

135+
### Kernel weight
136+
137+
I have so far not found a way to set the kernel weights `w(m)`.
138+
According to the paper, `w(2)` was set to 1 and `w(1)` was cross-validated, but never specified.
139+
Looking through Philip's code (included in [pydensecrf/densecrf](https://github.com/lucasb-eyer/pydensecrf/tree/master/pydensecrf/densecrf)),
140+
I couldn't find such explicit weights, and my guess is they are thus hard-coded to 1.
141+
If anyone knows otherwise, please open an issue or, better yet, a pull-request.
142+
131143
Inference
132144
---------
133145

@@ -200,3 +212,7 @@ Learning
200212

201213
The learning has not been fully wrapped. If you need it, get in touch or better
202214
yet, wrap it and submit a pull-request!
215+
216+
Here's a pointer for starters: issue#24. We need to wrap the gradients and getting/setting parameters.
217+
But then, we also need to do something with these, most likely call [minimizeLBFGS from optimization.cpp](https://github.com/lucasb-eyer/pydensecrf/blob/d824b89ee3867bca3e90b9f04c448f1b41821524/pydensecrf/densecrf/src/optimization.cpp).
218+
It should be relatively straightforward to just follow the learning examples included in the [original code](http://graphics.stanford.edu/projects/drf/densecrf_v_2_2.zip).

0 commit comments

Comments
 (0)