Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the demo script for inference #653

Merged
merged 4 commits into from
Feb 8, 2018
Merged

Conversation

kuke
Copy link
Collaborator

@kuke kuke commented Feb 7, 2018

Resolve #654

@kuke kuke requested review from pkuyym, guru4elephant and zhxfl and removed request for guru4elephant February 7, 2018 09:34
Copy link
Member

@zhxfl zhxfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

'--mean_var',
type=str,
default='data/global_mean_var_search26kHr',
help='mean var path')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refine the comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

'--infer_feature_lst',
type=str,
default='data/infer_feature.lst',
help='feature list path for inference.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the first character be upper case ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return infer_batch


def infer(args):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to replace args with specified arguments. Otherwise, this function is not well self-explained.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessary for this function only used in this file.

]

infer_data_reader = reader.DataReader(args.infer_feature_lst,
args.infer_label_lst)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infer_label_lst should be optional. However, currently the data reader hasn't been adapted to support inference. Just mark here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It should be.



def infer(args):
""" Get one batch of feature data and predicts labels for each sample.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why one batch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is no decoder right now, and printing predicted labels for more data would be ugly. This can be changed after the decoder is ready.

Copy link
Collaborator Author

@kuke kuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

return infer_batch


def infer(args):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessary for this function only used in this file.

]

infer_data_reader = reader.DataReader(args.infer_feature_lst,
args.infer_label_lst)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It should be.

'--mean_var',
type=str,
default='data/global_mean_var_search26kHr',
help='mean var path')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

'--infer_feature_lst',
type=str,
default='data/infer_feature.lst',
help='feature list path for inference.')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done



def infer(args):
""" Get one batch of feature data and predicts labels for each sample.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is no decoder right now, and printing predicted labels for more data would be ugly. This can be changed after the decoder is ready.

Copy link
Contributor

@pkuyym pkuyym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kuke kuke merged commit c9b41ee into PaddlePaddle:develop Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants