CEA-LIST / N2D2

N2D2 is an open source CAD framework for Deep Neural Network simulation and full DNN-based applications building.
Other
146 stars 36 forks source link

multiple common.config in .ini file #107

Closed MaximeAeva closed 2 years ago

MaximeAeva commented 2 years ago

Is it possible to set several common.config in ini file (like [common.config], [common.config2] ...) in order to set different learning rate and weights schedule per layer ?

I tried, it does not raise any error but it seems that only one common.config applied (I manage to change ConfigSection in related layers)

Thanks in advance.

Regards.

cmoineau commented 2 years ago

Hi Maxime, It is possible to have multiple config sections. You can find an example of multiple config section used here.

Relevant code :

[fc]
Input=pool
Type=Fc
NbOutputs=${NB_CLASSES}
ActivationFunction=Linear
WeightsFiller=XavierFiller
WeightsFiller.Scaling=$(0.0 if ${L} > 0 else 1.0)
BiasFiller=ConstantFiller
BiasFiller.Value=0.0
ConfigSection=common.config,fc.config

[common.config]
NoBias=1
WeightsSolver.LearningRate=${LR}
WeightsSolver.Decay=${WD}
BiasSolver.LearningRate=$(2.0 * ${LR})
BiasSolver.Decay=0.0
Solvers.Momentum=${MOMENTUM}
Solvers.LearningRatePolicy=PolyDecay
Solvers.Power=1.0
Solvers.MaxIterations=$([sp]_EpochSize * ${EPOCHS} / ${BATCH_SIZE})

[fc.config]
NoBias=0