| 60 | } |
| 61 | |
| 62 | float Decode(vector<dynet::real>& input) { |
| 63 | ComputationGraph cg; |
| 64 | NewGraph(cg); |
| 65 | |
| 66 | Expression x = dynet::input(cg, {(unsigned int)input.size()}, &input); |
| 67 | Expression h = tanh(W*x + b); |
| 68 | Expression y_pred = V*h + a; |
| 69 | return as_scalar(cg.forward(y_pred)); |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | void WriteToFile(string& filename, ParameterCollection& dynet_model) { |