-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Remove main_program
and startup_program
as the paramter of layer function
#6655
Conversation
main_program
and startup_program
as the paramter of layer function
@@ -165,28 +156,23 @@ def __init__(self, | |||
label=label, | |||
chunk_scheme=chunk_scheme, | |||
num_chunk_types=num_chunk_types, | |||
excluded_chunk_types=excluded_chunk_types, | |||
**kwargs) | |||
excluded_chunk_types=excluded_chunk_types, ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line 153:
kwargs = {'main_program': main_program}
should also be removed. I can not comment on unchanged line so I leave it here.
python/paddle/v2/fluid/evaluator.py
Outdated
layers.sums( | ||
input=[self.num_infer_chunks, num_infer_chunks], | ||
out=self.num_infer_chunks, | ||
**kwargs) | ||
out=self.num_infer_chunks, ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not remove ,
?
return default_main_program() | ||
else: | ||
return prog | ||
return default_main_program() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we can change the default program, I think it's improper to keep calling it default
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just main_program()
is cool. It could be done in the following PR
avg_cost = layers.mean(x=cost) | ||
|
||
sgd_optimizer = optimizer.SGDOptimizer(learning_rate=0.001) | ||
sgd_optimizer.minimize(avg_cost, init_program) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this init_program
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove init_program of optimizers in the following PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix #6458