From c2de2d2361915b98b2955460ba300cbffecf6194 Mon Sep 17 00:00:00 2001 From: karita Date: Wed, 25 Jan 2017 17:22:44 +0900 Subject: [PATCH 1/2] fix GraphCRF._set_size_joint_feature --- pystruct/models/graph_crf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystruct/models/graph_crf.py b/pystruct/models/graph_crf.py index 81860e90..84ebeb81 100644 --- a/pystruct/models/graph_crf.py +++ b/pystruct/models/graph_crf.py @@ -101,7 +101,7 @@ def _set_size_joint_feature(self): else: self.size_joint_feature = ( self.n_states * self.n_features - + self.n_states * (self.n_states + 1) / 2) + + self.n_states * (self.n_states + 1) // 2) def _get_edges(self, x): return x[1] From 86ed92cd98b6d22a86ff680f8708584f730b2fbe Mon Sep 17 00:00:00 2001 From: ShigekiKarita Date: Wed, 25 Jan 2017 17:34:21 +0900 Subject: [PATCH 2/2] ditto --- pystruct/models/latent_node_crf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystruct/models/latent_node_crf.py b/pystruct/models/latent_node_crf.py index 221f9549..030358ac 100644 --- a/pystruct/models/latent_node_crf.py +++ b/pystruct/models/latent_node_crf.py @@ -129,7 +129,7 @@ def _set_size_joint_feature(self): n_input_states = self.n_labels self.n_input_states = n_input_states self.size_joint_feature = (n_input_states * self.n_features + - self.n_states * (self.n_states + 1) / 2) + self.n_states * (self.n_states + 1) // 2) def initialize(self, X, Y): n_features = X[0][0].shape[1]