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

Fix/renset #42

Merged
merged 11 commits into from
Jan 15, 2018
Merged

Fix/renset #42

merged 11 commits into from
Jan 15, 2018

Conversation

dzhwinter
Copy link
Owner

fix resnet, add fluid cifar dataset support

Copy link
Collaborator

@qingqing01 qingqing01 left a 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]
Copy link
Collaborator

@qingqing01 qingqing01 Jan 8, 2018

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

done.

res_out = block_func(res_out, ch_out, 1)
return res_out

def resnet(input, class_dim, depth=50, data_format='NCHW'):
Copy link
Collaborator

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

Copy link
Collaborator

@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.

Basically LSTM.

@@ -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(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please avoid using tmp.

Copy link
Owner Author

Choose a reason for hiding this comment

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

done.


sentence = fluid.layers.fc(input=sentence, size=200, act='tanh')
sentence = fluid.layers.fc(input=embedding, size=hidden_dim * 4, bias_attr=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why multiply 4 here?

Copy link
Owner Author

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.

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')
Copy link
Collaborator

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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@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

@dzhwinter dzhwinter merged commit 8217a97 into master Jan 15, 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