You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ The `compat` argument can be any of the following:
109
109
- A 1D array, then a `DiagonalCompatibility` is being used.
110
110
- A 2D array, then a `MatrixCompatibility` is being used.
111
111
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>).
113
113
114
114
### Kernels
115
115
@@ -119,6 +119,10 @@ Possible values for the `kernel` argument are:
119
119
-`DIAG_KERNEL` (the default)
120
120
-`FULL_KERNEL`
121
121
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
+
122
126
### Normalizations
123
127
124
128
Possible values for the `normalization` argument are:
@@ -128,6 +132,14 @@ Possible values for the `normalization` argument are:
128
132
-`NORMALIZE_AFTER`
129
133
-`NORMALIZE_SYMMETRIC` (the default)
130
134
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
+
131
143
Inference
132
144
---------
133
145
@@ -200,3 +212,7 @@ Learning
200
212
201
213
The learning has not been fully wrapped. If you need it, get in touch or better
202
214
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