Skip to main content
corrected the answer; deleted 11 characters in body
Source Link
Brale
  • 2.4k
  • 1
  • 7
  • 15

I'm not sure what do you mean by one input. The input to the pruning agent is always the same, it's the convolutional layer $W$ of dimension $m \times h \times w$. The layer is taken from baseline model that is pretrained. The input doesn't change it's always the same. The output of the pruning agent is an array of probabilities to prune a discrete probability distributionspecific filter. For example if you have $3$ filters in a layer, the output of the pruning agent will be array of $3$ elements (the elements need to sum up to $1$ to represent valid distribution). Let's say its \begin{equation} y = [0.1, 0.2, 0.7] \end{equation}\begin{equation} y = [0.1, 0.6, 0.7] \end{equation} Each of these elements represents probability of pruning filter $i$ in layer $W$. So $0.1$ would be probability to prune filter $1$, $0.2$$0.6$ to prune filter $2$ and $0.7$ to prune filter $3$. Let's say you sample this distribution $2$ times and you get: $3, 2$$[0, 1, 1], [0, 0, 1]$. That means you would make 2 different models from the original baseline model. First model would have 2nd and 3rd filter pruned in layer $W$, and second model would have 2nd3rd filter pruned. The you run those 2 new models on your train and validation set, calculate objective function $R$. Then you update parameters $\theta$ of your pruning agent based on $R$. The original weights of layer $W$ stay untouched. Then you do another inference of the pruning model $\pi$ with updated parameters $\theta$ (the input is still original $W$). You will get another discrete probability distributionarray of probabilities and you keep repeating previous steps that i described until parameters $\theta$ converge. When they converge you make final pruning.

I'm not sure what do you mean by one input. The input to the pruning agent is always the same, it's the convolutional layer $W$ of dimension $m \times h \times w$. The layer is taken from baseline model that is pretrained. The input doesn't change it's always the same. The output of the pruning agent is a discrete probability distribution. For example if you have $3$ filters in a layer, the output of the pruning agent will be array of $3$ elements (the elements need to sum up to $1$ to represent valid distribution). Let's say its \begin{equation} y = [0.1, 0.2, 0.7] \end{equation} Each of these elements represents probability of pruning filter $i$ in layer $W$. So $0.1$ would be probability to prune filter $1$, $0.2$ to prune filter $2$ and $0.7$ to prune filter $3$. Let's say you sample this distribution $2$ times and you get: $3, 2$. That means you would make 2 different models from the original baseline model. First model would have 3rd filter pruned in layer $W$, and second model would have 2nd filter pruned. The you run those 2 new models on your train and validation set, calculate objective function $R$. Then you update parameters $\theta$ of your pruning agent based on $R$. The original weights of layer $W$ stay untouched. Then you do another inference of the pruning model $\pi$ with updated parameters $\theta$ (the input is still original $W$). You will get another discrete probability distribution and you keep repeating previous steps that i described until parameters $\theta$ converge. When they converge you make final pruning.

I'm not sure what do you mean by one input. The input to the pruning agent is always the same, it's the convolutional layer $W$ of dimension $m \times h \times w$. The layer is taken from baseline model that is pretrained. The input doesn't change it's always the same. The output of the pruning agent is an array of probabilities to prune a specific filter. For example if you have $3$ filters in a layer, the output of the pruning agent will be array of $3$ elements . Let's say its \begin{equation} y = [0.1, 0.6, 0.7] \end{equation} Each of these elements represents probability of pruning filter $i$ in layer $W$. So $0.1$ would be probability to prune filter $1$, $0.6$ to prune filter $2$ and $0.7$ to prune filter $3$. Let's say you sample this distribution $2$ times and you get: $[0, 1, 1], [0, 0, 1]$. That means you would make 2 different models from the original baseline model. First model would have 2nd and 3rd filter pruned in layer $W$, and second model would have 3rd filter pruned. The you run those 2 new models on your train and validation set, calculate objective function $R$. Then you update parameters $\theta$ of your pruning agent based on $R$. The original weights of layer $W$ stay untouched. Then you do another inference of the pruning model $\pi$ with updated parameters $\theta$ (the input is still original $W$). You will get another array of probabilities and you keep repeating previous steps that i described until parameters $\theta$ converge. When they converge you make final pruning.

Source Link
Brale
  • 2.4k
  • 1
  • 7
  • 15

I'm not sure what do you mean by one input. The input to the pruning agent is always the same, it's the convolutional layer $W$ of dimension $m \times h \times w$. The layer is taken from baseline model that is pretrained. The input doesn't change it's always the same. The output of the pruning agent is a discrete probability distribution. For example if you have $3$ filters in a layer, the output of the pruning agent will be array of $3$ elements (the elements need to sum up to $1$ to represent valid distribution). Let's say its \begin{equation} y = [0.1, 0.2, 0.7] \end{equation} Each of these elements represents probability of pruning filter $i$ in layer $W$. So $0.1$ would be probability to prune filter $1$, $0.2$ to prune filter $2$ and $0.7$ to prune filter $3$. Let's say you sample this distribution $2$ times and you get: $3, 2$. That means you would make 2 different models from the original baseline model. First model would have 3rd filter pruned in layer $W$, and second model would have 2nd filter pruned. The you run those 2 new models on your train and validation set, calculate objective function $R$. Then you update parameters $\theta$ of your pruning agent based on $R$. The original weights of layer $W$ stay untouched. Then you do another inference of the pruning model $\pi$ with updated parameters $\theta$ (the input is still original $W$). You will get another discrete probability distribution and you keep repeating previous steps that i described until parameters $\theta$ converge. When they converge you make final pruning.