diff --git a/deep_learning4e.py b/deep_learning4e.py index 9f5b0a8f7..7250751d3 100644 --- a/deep_learning4e.py +++ b/deep_learning4e.py @@ -575,7 +575,7 @@ def AutoencoderLearner(inputs, encoding_size, epochs=200, verbose=False): model.add(Dense(input_size, activation='relu', kernel_initializer='random_uniform', bias_initializer='ones')) # update model with sgd - sgd = optimizers.SGD(lr=0.01) + sgd = optimizers.SGD(learning_rate=0.01) model.compile(loss='mean_squared_error', optimizer=sgd, metrics=['accuracy']) # train the model diff --git a/gui/tsp.py b/gui/tsp.py index 590fff354..bbe060499 100644 --- a/gui/tsp.py +++ b/gui/tsp.py @@ -260,7 +260,7 @@ def fitness_fn(state): while True: population = [mutate(recombine(*select(2, population, fitness_fn)), self.mutation_rate.get()) for _ in range(len(population))] - current_best = np.argmax(population, key=fitness_fn) + current_best = utils.argmax_random_ties(population, key=fitness_fn) if fitness_fn(current_best) > fitness_fn(all_time_best): all_time_best = current_best self.cost.set("Cost = " + str('%0.3f' % (-1 * problem.value(all_time_best))))