8000 Batch size incorrect · Issue #307 · KindXiaoming/pykan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Batch size incorrect #307
Closed
Closed
@kamil-oster

Description

@kamil-oster

These two lines need a bit attention because if batch > number of samples in testing here:

if batch == -1 or batch > dataset['train_input'].shape[0]:
    batch_size = dataset['train_input'].shape[0]
    batch_size_test = dataset['test_input'].shape[0]
else:
    batch_size = batch
    batch_size_test = batch

then this is invalid:
test_id = np.random.choice(dataset['test_input'].shape[0], batch_size_test, replace=False)

On the other hand, what is the purpose of batching testing dataset if it's used for testing the model? Surely, batching should only be done on training dataset, i.e. this line is not required?

test_loss = loss_fn_eval(self.forward(dataset['test_input'][test_id].to(device)), dataset['test_label'][test_id].to(device))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0