Skip to content

Commit

Permalink
bug fixed (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng-jin committed Oct 19, 2018
1 parent fbc7987 commit d5f3b36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions autokeras/image/image_supervised.py
Expand Up @@ -158,9 +158,11 @@ def fit(self, x, y, x_test=None, y_test=None, time_limit=None):
y = self.transform_y(y)
if x_test is None or y_test is None:
# Divide training data into training and testing data.
validation_set_size = int(len(y) * Constant.VALIDATION_SET_SIZE)
validation_set_size = min(validation_set_size, 500)
validation_set_size = max(validation_set_size, 1)
x_train, x_test, y_train, y_test = train_test_split(x, y,
test_size=min(Constant.VALIDATION_SET_SIZE,
int(len(y) * 0.2)),
test_size=validation_set_size,
random_state=42)
else:
x_train = x
Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_image_supervised.py
Expand Up @@ -74,7 +74,7 @@ def test_timeout_resume(_):
# make it impossible to complete within 10sec
Constant.MAX_MODEL_NUM = 1000
Constant.SEARCH_MAX_ITER = 1
Constant.T_MIN = 0.8
# Constant.T_MIN = 0.8
train_x = np.random.rand(100, 25, 25, 1)
train_y = np.random.randint(0, 5, 100)
test_x = np.random.rand(100, 25, 25, 1)
Expand Down

0 comments on commit d5f3b36

Please sign in to comment.