// PredictMix.h // copyright 29 July 1997 Kevin Karplus #ifndef PredictMix_H #define PredictMix_H #include "Regularizer/DirichletReg.h" // This file is for plug-in functions to add to a NeuralNet // to make it predict mixture coefficients for a Dirichlet mixture // in each position. // The objective function is to minimize the encoding cost of the // observed counts (or weighted counts) given the inputs to the network // (usually single template residues, but possibly an alignment of // a subfamily). // Replace the mixture coefficients of dir with mix (which should have // dir->num_components() entries. // then compute the encoding cost of the out_counts using // the mean posterior estimate of the modified mixture given the in_counts double cost_mix_output(const float *mix, const DirichletReg *dir, const float *in_counts, const float *out_counts); // Compute the partials of cost_mix_output with respect to mix. // The output array partials should have dir->num_components() elements. void partials_of_cost_wrt_mix(double *partials, const float* mix, const DirichletReg *dir, const float *in_counts, const float *out_counts); #endif