-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix/renset #42
Fix/renset #42
Conversation
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.
fluid/resnet50.py
I think this name is not good. This is a general config, not only for 50 layers.
if args.data_format == 'NCHW': | ||
data_shape = [3, 224, 224] | ||
else: | ||
data_shape = [224, 224, 3] |
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 network is different for 224 * 224 input and 32 * 32 input, please refer to https://github.com/dzhwinter/benchmark/blob/master/tensorflow/resnet50.py#L360
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.
done.
fluid/resnet50.py
Outdated
res_out = block_func(res_out, ch_out, 1) | ||
return res_out | ||
|
||
def resnet(input, class_dim, depth=50, data_format='NCHW'): |
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.
叫 resnet_imagenet
,和TensorFlow里的配置对应吧 https://github.com/dzhwinter/benchmark/blob/master/tensorflow/resnet50.py#L220
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.
Basically LSTM.
fluid/resnet50.py
Outdated
@@ -71,44 +77,44 @@ def print_arguments(args): | |||
print('%s: %s' % (arg, value)) | |||
print('------------------------------------------------') | |||
|
|||
def conv_bn_layer(input, ch_out, filter_size, stride, padding, act='relu'): | |||
tmp = fluid.layers.conv2d( |
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.
Please avoid using tmp
.
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.
done.
fluid/stacked_dynamic_lstm.py
Outdated
|
||
sentence = fluid.layers.fc(input=sentence, size=200, act='tanh') | ||
sentence = fluid.layers.fc(input=embedding, size=hidden_dim * 4, bias_attr=True) |
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 multiply 4 here?
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.
I thought there will be four cell inside DynamicRNN, so it should be multiplied with 4, fixed.
fluid/stacked_dynamic_lstm.py
Outdated
label=fluid.layers.data( | ||
name='label', shape=[1], dtype='int64')) | ||
loss = fluid.layers.mean(x=loss) | ||
lstm_out = fluid.layers.sequence_pool(input=rnn(), pool_type='max') |
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.
Please double check 'max' or 'last' here.
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.
done
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 resnet, add fluid cifar dataset support