Skip to content

Commit

Permalink
modified acc calculation (PaddlePaddle#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
tink2123 authored and phlrain committed Jul 1, 2019
1 parent 08d48fe commit 25d6fba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dygraph/se_resnext/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def optimizer_setting(params):
bd = [step * e for e in ls["epochs"]]
lr = params["lr"]
num_epochs = params["num_epochs"]
print("lr:",lr)
optimizer = fluid.optimizer.Momentum(
learning_rate=fluid.layers.cosine_decay(
learning_rate=lr,step_each_epoch=step,epochs=num_epochs),
Expand Down Expand Up @@ -367,11 +366,11 @@ def train():
test_reader = paddle.batch(
paddle.dataset.flowers.test(use_xmap=False), batch_size=32)

total_loss = 0.0
total_acc1 = 0.0
total_acc5 = 0.0
total_sample = 0
for epoch_id in range(epoch_num):
total_loss = 0.0
total_acc1 = 0.0
total_acc5 = 0.0
total_sample = 0
for batch_id, data in enumerate(train_reader()):

dy_x_data = np.array(
Expand Down

0 comments on commit 25d6fba

Please sign in to comment.