chainer-chemistry icon indicating copy to clipboard operation
chainer-chemistry copied to clipboard

A little question

Open rookiecoder-chen opened this issue 5 years ago • 6 comments

Hello, I trained my own CSV dataset by using chainer-chemistry, but I only got MAE when I used the model for prediction. How can I get the prediction value of each test data? I want to be able to compare it with the true value of my data.

rookiecoder-chen avatar Dec 21 '19 13:12 rookiecoder-chen

You can use regressor.predict method to get predict value.

  • https://github.com/chainer/chainer-chemistry/blob/master/examples/qm9/predict_qm9.py#L142-L143

Evaluator only calculates MAE or other metrics.

corochann avatar Dec 22 '19 09:12 corochann

OK, thank you very much for your reply. If I want to draw the loss or MAE in the model training process, what should I do?

rookiecoder-chen avatar Jan 09 '20 03:01 rookiecoder-chen

Do you use Trainer to train model?

In that case you can use PlotReport, please refer this example. https://github.com/chainer/chainer/blob/90b0cd425014d31aae122f21bce20ecf23486e11/examples/mnist/train_mnist.py#L113

corochann avatar Jan 09 '20 03:01 corochann

I used the model in example / own_dataset to train my own data. The model uses the run_train () method. Is it different from the Trainer?

rookiecoder-chen avatar Jan 09 '20 04:01 rookiecoder-chen

It internally uses Trainer.

  • https://github.com/chainer/chainer-chemistry/blob/56e83dedb5de9dc9eb08ebf292be9ba76a4883ba/chainer_chemistry/utils/train_utils.py#L11

I guess you can pass below to run_train method: extensions_list=[extensions.PlotReport(['main/loss', 'validation/main/loss'], 'epoch', file_name='loss.png')] to add PlotReport extensions.

corochann avatar Jan 09 '20 04:01 corochann

OK, when using CSV data for multiple label training, I found that the model only outputs one loss. How do you handle multiple label training? Will different labels affect each other?

rookiecoder-chen avatar Jan 09 '20 06:01 rookiecoder-chen