diff options
-rw-r--r-- | decoder/lazy.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/decoder/lazy.cc b/decoder/lazy.cc index 0f12a1ff..c4138d7b 100644 --- a/decoder/lazy.cc +++ b/decoder/lazy.cc @@ -111,18 +111,18 @@ template <class Model> void Lazy<Model>::Search(unsigned int pop_limit, const Hy search::Config config(weights_, pop_limit); search::Context<Model> context(config, m_); - for (unsigned int i = 0; i < hg.nodes_.size(); ++i) { + for (unsigned int i = 0; i < hg.nodes_.size() - 1; ++i) { search::Vertex &out_vertex = out_vertices[i]; const Hypergraph::EdgesVector &down_edges = hg.nodes_[i].in_edges_; for (unsigned int j = 0; j < down_edges.size(); ++j) { unsigned int edge_index = down_edges[j]; - ConvertEdge(context, i == hg.nodes_.size() - 1, out_vertices.get(), hg.edges_[edge_index], out_edges[edge_index]); + ConvertEdge(context, i == hg.nodes_.size() - 2, out_vertices.get(), hg.edges_[edge_index], out_edges[edge_index]); out_vertex.Add(out_edges[edge_index]); } out_vertex.FinishedAdding(); search::VertexGenerator(context, out_vertex); } - search::PartialVertex top = out_vertices[hg.nodes_.size() - 1].RootPartial(); + search::PartialVertex top = out_vertices[hg.nodes_.size() - 2].RootPartial(); if (top.Empty()) { std::cout << "NO PATH FOUND"; } else { @@ -168,6 +168,7 @@ boost::scoped_ptr<LazyBase> AwfulGlobalLazy; void PassToLazy(const char *model_file, const std::vector<weight_t> &weights, unsigned int pop_limit, const Hypergraph &hg) { if (!AwfulGlobalLazy.get()) { + std::cerr << "Pop limit " << pop_limit << std::endl; AwfulGlobalLazy.reset(LazyBase::Load(model_file, weights)); } AwfulGlobalLazy->Search(pop_limit, hg); |