|
Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
A class to construct a ModelMessage from a Model instance. More...
#include <model-proto-writer.H>
Public Member Functions | |
| ModelProtoWriter () | |
| Constructs a new instance that can serialize Model instances to ModelMessage protocol buffer messages. More... | |
| virtual | ~ModelProtoWriter () |
| Destroys this writer. More... | |
| virtual void | Write (const Model *model, ModelMessage *model_message, bool write_features=true) const =0 |
| Serializes a Model instance to a ModelMessage. More... | |
| virtual void | WriteFeatures (const Model *model, ostream &os, bool output_best_epoch=false, double weight=1.0, bool output_key=false, const string separator="\t") const =0 |
Writes out the features of this model to a series of FeatureMessage instances using the specified ConfusionProtoIO instance. More... | |
Public Member Functions inherited from reranker::FactoryConstructible | |
| virtual | ~FactoryConstructible () |
| virtual void | RegisterInitializers (Initializers &initializers) |
| virtual void | Init (const Environment *env, const string &arg) |
A class to construct a ModelMessage from a Model instance.
Definition at line 61 of file model-proto-writer.H.
|
inline |
Constructs a new instance that can serialize Model instances to ModelMessage protocol buffer messages.
Definition at line 65 of file model-proto-writer.H.
|
inlinevirtual |
Destroys this writer.
Definition at line 67 of file model-proto-writer.H.
|
pure virtual |
Serializes a Model instance to a ModelMessage.
| model | the Model to be serialized to the specified ModelMessage |
| model_message | the ModelMessage to be filled in by this method with the serialized version of the specified Model |
| write_features | whether the features of the specified Model should be written out |
Implemented in reranker::PerceptronModelProtoWriter.
|
pure virtual |
Writes out the features of this model to a series of FeatureMessage instances using the specified ConfusionProtoIO instance.
| model | the Model to be serialized to the specified ModelMessage |
| os | the output stream to which to write features |
| output_best_epoch | output the weights of the best epoch of training, as opposed to the most recent epoch |
| weight | the weight by which all feature weights should be multiplied before being output |
| output_key | output the key (feature name) and separator for each feature |
| separator | the separator string to output between each feature’s key and its base64-encoded FeatureMessage (only used if output_key == True) |
Implemented in reranker::PerceptronModelProtoWriter.
1.8.6