Skip to content

Commit

Permalink
Python3 division.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcamino committed Jan 28, 2019
1 parent dde9b4e commit 65e48ab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion multi_categorical_gans/datasets/dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division

import numpy as np


Expand Down Expand Up @@ -29,7 +31,7 @@ def __init__(self, features, indices, batch_size):
self.batch_size = batch_size

self.batch_index = 0
self.num_batches = int(np.ceil(len(features) / float(batch_size)))
self.num_batches = int(np.ceil(len(features) / batch_size))

def __iter__(self):
return self
Expand Down
3 changes: 2 additions & 1 deletion multi_categorical_gans/datasets/synthetic/generate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
from __future__ import print_function

import argparse
Expand Down Expand Up @@ -53,7 +54,7 @@ def print_matrix_stats(matrix, num_samples, num_features):
print("Mean ones per column:", num_ones_per_column.mean())
print("Total ones:", num_ones)
print("Total positions:", num_positions)
print("Total ratio of ones:", num_ones / float(num_positions))
print("Total ratio of ones:", num_ones / num_positions)
print("Empty rows:", np.sum(num_ones_per_row == 0))
print("Full rows:", np.sum(num_ones_per_row == num_features))
print("Empty columns:", np.sum(num_ones_per_column == 0))
Expand Down
1 change: 1 addition & 0 deletions multi_categorical_gans/methods/mc_gumbel/trainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
from __future__ import print_function

import argparse
Expand Down
1 change: 1 addition & 0 deletions multi_categorical_gans/methods/medgan/trainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
from __future__ import print_function

import argparse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import division
from __future__ import print_function

import argparse
Expand All @@ -10,7 +11,7 @@


def probability(data):
return data.sum() / float(data.shape[0])
return data.sum() / data.shape[0]


def probabilities_by_dimension(data):
Expand Down

0 comments on commit 65e48ab

Please sign in to comment.