Skip to content

Commit

Permalink
Merge pull request #4 from GlobalFishingWatch/wide
Browse files Browse the repository at this point in the history
Merge latest changes from wide
  • Loading branch information
bitsofbits committed Jul 23, 2019
2 parents 790ea84 + 2822b55 commit d1acb2e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions track_based_models/dual_track_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def create_features_and_times(cls, data1, data2, angle=77, max_deltas=0):
i1 = min(i0 + cls.time_points + max_deltas * cls.time_point_delta, len(y_tv))
_, f_chunk = cls.cook_paired_data(*data, noise=0,
start_ndx=i0, end_ndx=i1)

print(i0, i1, cls.time_points, f_chunk.shape)
features.append(f_chunk)
i0 = i0 + max_deltas * cls.time_point_delta + 1
times = t[cls.time_points//2:-cls.time_points//2]
Expand Down Expand Up @@ -344,7 +342,11 @@ def predict_from_data(self, data1, data2, max_deltas=0):
for angle in [77, 167, 180, 270]:
features, times = self.create_features_and_times(data1, data2, angle=angle,
max_deltas=max_deltas)
predictions_for_angle = np.concatenate(self.predict(features))
predictions.append(predictions_for_angle)
return times, np.mean(predictions, axis=0) > 0.5
if len(features) > 0:
predictions_for_angle = np.concatenate(self.predict(features))
predictions.append(predictions_for_angle)
if len(times) > 0:
return times, np.mean(predictions, axis=0) > 0.5
else:
return times, []

0 comments on commit d1acb2e

Please sign in to comment.