From 6b1a2121cba7c32686d29515a6dc322e62435049 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Fri, 27 Feb 2015 12:43:45 +0100
Subject: simplified update
---
training/dtrain/update.h | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
(limited to 'training/dtrain')
diff --git a/training/dtrain/update.h b/training/dtrain/update.h
index 72d369c4..d7224cca 100644
--- a/training/dtrain/update.h
+++ b/training/dtrain/update.h
@@ -10,6 +10,16 @@ _cmp(ScoredHyp a, ScoredHyp b)
return a.gold > b.gold;
}
+inline bool
+_good(ScoredHyp& a, ScoredHyp& b, weight_t margin)
+{
+ if ((a.model-b.model)>margin
+ || a.gold==b.gold)
+ return true;
+
+ return false;
+}
+
/*
* multipartite ranking
* sort (descending) by bleu
@@ -19,35 +29,24 @@ _cmp(ScoredHyp a, ScoredHyp b)
inline size_t
CollectUpdates(vector