Learning weights

The process of weight inference has been introduced in (Kippen & Bel 1992). Given a set of items accepted by the current grammar it is possible to infer rule weights from the set of examples. The weight of each rule will be the number of times it has been used in parsing the sample set. Weight inference is used to improve the quality of randomly generated musical items by increasing the probability that these items resemble a set of items given as an input by an expert musician. See for instance the weights of rules in "-gr.dhin--".

Try this procedure as follows. Load "-gr.dhin--" and "-da.dhin--". Compile the grammar and produce its templates. (It's a good idea to save the current grammar with its templates, but remember that templates should be computed again each time structural rules have been modified in the grammar.) Now click "Save weights" on the Control panel to save current grammar weights in a "-wg" file. Then click "Set weights" and reset all weights to 0. Select all items in the "Data" window, click "Learn weights" and answer default options in all dialogs.