Allow custom weight_decay in TF-Hub Image modules
Summary: Currently there is no way to provide weight decay to Image modules of TF-Hub - it is hardcoded inside the model. This curtails the customisability of the model as weight decay is one of the core hyperparameters in any model.
Reference: Stackoverflow discussion : link
Details: Current implementation of image modules are using TF-Slim - and the weight decay is hardcoded (for e.g. for Inception V3 it is 0.00004). Currently i'm implementing transfer learning for a geology dataset with Inception - and would really appreciate the capability to tune weight decay.
p.s: TF-Hub is an awesome idea - kudos to the TF Hub developers. Special thanks to @arnoegw for swift clarifications!
@alabatie
Follow up question on the stackoverflow discussion: @arnoegw How can I know what L2 reg. parameters was actually used for the arg_scope in slim when exporting the model. For example, for the resnet_50_v2? I think having access to the actual weight decay parameters is very useful, as it's a core hyperparmeter that one often want to tune to the dataset/circumstances where the hub model is used
@alabatie @MeTaNoV Is there any plans to incorporate this?
@JoelKronander That is a very good point.
With only the actual module, currently the only way is to inspect the graph, starting from the REGULARIZATION_LOSSES collection.
Knowing that google/imagenet/resnet_v2_/ have been exported from https://github.com/tensorflow/models/blob/master/research/slim/nets/resnet_v2.py with the default arg_scope from https://github.com/tensorflow/models/blob/master/research/slim/nets/resnet_utils.py, inspecting the source code shows it's weight_decay=0.0001
There should be a better (and more trustworthy) way...