Matlab中mat檔案model參數含義
模型檔案是按照Latent SVM模型儲存文法儲存參數的,利用了查表的思想,具體細節需要參考原始論文。這樣儲存的目的好像是計算方便。
1.model簡單節點內容
model.class= 'bottle'
model.year= 2011
model.note= 15-50-36
等
2. model有以下關鍵節點
filters:[1x42 struct]
rules: {1x81 cell}
symbols:[1x81 struct]
start: 2
裡面的數字僅為了說明使用
model.symbols(i)=
type: 'T'
filter: 3
T:terminal,對應一個filter,並且給出其index。N->non-terminal,非filter,而是一個deformation
model
model.filters{i}=
w: [7x11x31 double]
blocklabel: 1
symmetric: 'M'
size: [7 11]
flip: 0
symbol: 1
包含the filter weights和 blocklabel,symmetric有兩種情況M和N,M表明有一個垂直鏡像部分;N表示沒有。如果symmetric
== 'M'那麼將會有兩個filters有相同的blocklabel。
flip表明w需要filp組成filter。
symbol記錄model.symbol的標記,例如model.symbols{8}.filter = 3,那麼model.filter{3}.bymbol =
8;
model.rules是模型存取的關鍵,model.rules和symbol大小相同,每個model.rules中都有一個symbol。
LHS: lefthand side
RHS: righthand side
The cellmodel.rules{i} holds an array struct that lists the rules for which I acts asthe left-hand side symbol. So,model.rules{4}(1) and model.rules{4}(2)
are the first two productions forsymbol 4 in some imaginary grammar. Thefield model.start holds the distinguished start symbol for the grammar. Let's use that symbol as an example.
model.rules{model.start}(1)=
type: 'S'
lhs: 2
rhs: [1 11 15 19 23 27 31]
offset: { w: -3.394 blocklabel: 2 }
anchor: {[0 0 0] [12 0 1] [4 5 1] [13 8 1] [0 0 1] [16 0 1] [0 5 1]}
Here isthe first rule with model.start on the LHS. In the case of a 6 component mixture model, model.rules {model.start} isa struct array of 6 elements.
The fieldlhs is simply a convenience field indicating what the production's LHS is. The field rhs holds the symbols that appearon the production's right-hand side. Thefield type is 'S' if this is a structural rule or 'D' if this is a deformationrule. Now
I'll split the description intotwo cases.
case 1:structural rule
The fieldoffset holds the offset value and its blocklabel (these will be shared for mirroredcomponents). The anchor field holds theparameters of
the "structure function" that defines how each of thesymbols in the rhs is placed relative to a placement of the lhs symbol. The format is [dx dy ds], where 2^ds is thescale change. So ds = 1 implies that therhs symbol
lives attwice resolution of the lhs symbol. Thevalues of dx, dy are HOG cell displacements at the rhs's native scale. Note that dx and dy are displacements, sothey are 1 less than the anchor values that
were defined in the old model. The first symbol on the rhs has anchor = [0 00], because this symbol is a terminal for the root filter.
case 2:deformation rule
Let'slook at the second symbol on the rhs in the rule above.
model.rules{11}=
type: 'D'
lhs: 11
rhs: 10
def: {
w: [0.0209 -0.0015 0.0155 0.0010]
blocklabel: 8
flip: 0
symmetric: 'M'
}
offset: { w: 0 blocklabel: 7 }
Deformationrules don't have an anchor field, but do have a def field. The def field describes the deformation modelfor this rule, and so it includes
the coefficients and the blocklabel. The def.symmetric field can be 'M' if thereis a vertically mirrored deformation rule or 'N' if there is no
symmetry constraint. In the case of 'M', flipindicates how to write features and read models (just like features.flip). There's an implicit assumption in the codethat deformation rules only have one
symbol on the right-hand side (though itneed not be a terminal).
def.w用於求取deformation model,也就是XML中的Penalty節點內容