keskarnitish / large-batch-training Goto Github PK
View Code? Open in Web Editor NEWCode to reproduce some of the figures in the paper "On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima"
License: MIT License
Code to reproduce some of the figures in the paper "On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima"
License: MIT License
hi Nitish,
Can you release the code of computing sharpness? I want to use the metric in my paper.
Is there a Caffe implementation?
Thanks!
I run python plot_parametric_plot.py -n C1
, and get following error:
Traceback (most recent call last):
File "plot_parametric_plot.py", line 64, in <module>
model = network_zoo.shallownet(nb_classes)
File "/home//github/users/wenwei202/large-batch-training/network_zoo.py", line 37, in shallownet
model.add(BatchNormalization(mode=2,axis=1))
File "/home//anaconda2/lib/python2.7/site-packages/Keras-1.0.0-py2.7.egg/keras/models.py", line 139, in add
output_tensor = layer(self.outputs[0])
File "/home//anaconda2/lib/python2.7/site-packages/Keras-1.0.0-py2.7.egg/keras/engine/topology.py", line 485, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home//anaconda2/lib/python2.7/site-packages/Keras-1.0.0-py2.7.egg/keras/engine/topology.py", line 543, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home//anaconda2/lib/python2.7/site-packages/Keras-1.0.0-py2.7.egg/keras/engine/topology.py", line 148, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/home//anaconda2/lib/python2.7/site-packages/Keras-1.0.0-py2.7.egg/keras/layers/normalization.py", line 118, in call
return out
UnboundLocalError: local variable 'out' referenced before assignment
Keras version: 1
Tensorflow: '1.4.0'
Hi Nitish,
Could you include the code for computing sharpness as well.
Thanks,
Neelesh
Hi @keskarnitish, I would like to ask a question that how much is a small batch and how much is a large batch in the real problems. For example, in the object detection, segmentation and pose estimation, we even set mini-batch as 2. Sometimes we also set the minibatch as 32. So how to choose batch number in these problems. Thanks.
It seems like keras has changed the parameter of the function BatchNormalization
. The error msg:
Traceback (most recent call last):
File "plot_parametric_plot.py", line 64, in <module>
model = network_zoo.shallownet(nb_classes)
File "/home/nqluo/experiement/large-batch-training-master/network_zoo.py", line 37, in shallownet
model.add(BatchNormalization(mode=2,axis=1))
File "/home/nqluo/anaconda3/envs/tf14-gpu/lib/python3.7/site-packages/keras/legacy/interfaces.py", line 34, in wrapper
args, kwargs, converted = preprocessor(args, kwargs)
File "/home/nqluo/anaconda3/envs/tf14-gpu/lib/python3.7/site-packages/keras/legacy/interfaces.py", line 451, in batchnorm_args_preprocessor
raise TypeError('The `mode` argument of `BatchNormalization` '
TypeError: The `mode` argument of `BatchNormalization` no longer exists. `mode=1` and `mode=2` are no longer supported.
Is there any problem that makes the implementation of GPU version difficult? I tried to get a linear combination of SB weights and LB weights in GPU mode, and got weird issues. Did you have similar problems before?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.