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

Mapping width_coefficient, depth_coefficient and image_size to paper's parameters #282

Closed
fpaissan opened this issue Apr 23, 2021 · 2 comments

Comments

@fpaissan
Copy link

fpaissan commented Apr 23, 2021

Dear @lukemelas,

many thanks for the useful implementation you provided.
I am reaching out to ask how you map the width_coefficient, depth_coefficient and image_size in your utils.py file to the paper's alpha, beta and gamma. I see you created the efficientnet_params method to generate EfficientNets from B0 all the way to B8.

From what I understand from your implementation this code returns EfficientNet-B0, and in fact it does.

block_args, global_args = efficientnet(
    width_coefficient=1.0, 
    depth_coefficient=1.1, 
    image_size=240
)

model = EfficientNet(block_args, global_args)

From the EfficientNetv1's paper, we know that α = 1.2, β = 1.1, γ=1.15 for the B0 architecture and are afterward scaled all the way to B7 using compound scaling.

My question is, did you implement compound scaling for custom (α, β, γ)? In case, how did you map the (α, β, γ) tuple to width_coefficient, depth_coefficient and image_size?

Thanks in advance.

Best,
Francesco.

@lukemelas
Copy link
Owner

Hi Francesco,

I implemented the models B0-B7 to match the original implementation. My understanding is that these parameters have a slight mismatch from the paper. The original issue is here: tensorflow/tpu#390

Let me know if you were asking about something else.

Best,
Luke

@fpaissan
Copy link
Author

Hi Luke,

thanks for the useful reference. You are right, here there's a quite detailed description of how the model is scaled using the parameters proposed in efficientnet_builder.py, which are the same parameters you used.

Thanks again.
Best,
Francesco.

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

No branches or pull requests

2 participants