Skip to content

Lab-10장 코드에 관한 질문입니다. #33

@minocrafft

Description

@minocrafft

`with summary_writer.as_default(): # for tensorboard
for epoch in range(start_epoch, training_epochs):
for idx, (train_input, train_label) in enumerate(train_dataset):
grads = grad(network, train_input, train_label)
optimizer.apply_gradients(grads_and_vars=zip(grads, network.variables))

            train_loss = loss_fn(network, train_input, train_label)
            train_accuracy = accuracy_fn(network, train_input, train_label)
            
            for test_input, test_label in test_dataset:                
                test_accuracy = accuracy_fn(network, test_input, test_label)

            tf.summary.scalar(name='train_loss', data=train_loss, step=counter)
            tf.summary.scalar(name='train_accuracy', data=train_accuracy, step=counter)
            tf.summary.scalar(name='test_accuracy', data=test_accuracy, step=counter)

            print(
                "Epoch: [%2d] [%5d/%5d] time: %4.4f, train_loss: %.8f, train_accuracy: %.4f, test_Accuracy: %.4f" \
                % (epoch, idx, training_iterations, time() - start_time, train_loss, train_accuracy,
                   test_accuracy))
            counter += 1                
    checkpoint.save(file_prefix=checkpoint_prefix + '-{}'.format(counter))`

부분에서 train 과정에서 test 데이터를 매 epoch마다 사용해서 검증하는 것이 이해가 잘 안되는데 이런 상황이면 test가 아니라 validation으로 봐야되지 않나요?

궁금해서 질문남깁니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions