不可训练参数的定义是什么? [英] What is the definition of a non-trainable parameter?

查看:311
本文介绍了不可训练参数的定义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模型中不可训练参数的定义是什么?

What is the definition of non-trainable parameter in a model?

例如,当您构建自己的模型时,其默认值为0,但当您要使用初始模型时,它将变为其他值而不是0.其背后的原因是什么?

For example, while you are building your own model, its value is 0 as a default, but when you want to use an inception model, it is becoming something else rather than 0. What would be the reason behind it?

推荐答案

不可训练的参数是一个广泛的主题.一个简单的例子就是考虑任何特定的NN模型及其架构的情况.

Non-trainable parameters are quite a broad subject. A straightforward example is to consider the case of any specific NN model and its architecture.

说,我们已经在Keras中设置了您的网络定义,您的体系结构类似于256->500->500->1.根据这个定义,我们似乎有一个回归模型(一个输出),该模型具有两个隐藏层(每个500个节点)和256个输入.

Say we have already setup your network definition in Keras, and your architecture is something like 256->500->500->1. Based on this definition, we seem to have a Regression Model (one output) with two hidden layers (500 nodes each) and an input of 256.

模型的一个不可训练参数是例如隐藏层本身的数量(2).其他可能是每个隐藏层上的节点(在这种情况下为500),甚至每个单独层上的节点,也可以为每个层提供一个参数以及层本身的数量.

One non-trainable parameters of your model is, for example, the number of hidden layers itself (2). Other could be the nodes on each hidden layer (500 in this case), or even the nodes on each individual layer, giving you one parameter per layer plus the number of layers itself.

这些参数是不可训练的",因为您无法使用训练数据优化其值.训练算法(例如反向传播)将优化和更新权重,这是此处的实际可训练参数(通常为数千个,具体取决于您的连接).训练数据本身无法帮助您确定那些不可训练的参数.

These parameters are "non-trainable" because you can't optimize its value with your training data. Training algorithms (like back-propagation) will optimize and update the weights of your network, which are the actual trainable parameters here (usually several thousands, depending on your connections). Your training data as it is can't help you determine those non-trainable parameters.

但是,这并不意味着numberHiddenLayers根本不可训练,仅意味着在此模型及其实现中,我们无法做到这一点. 我们可以使numberHiddenLayers可培训;最简单的方法是定义另一种ML算法,该算法以该模型为输入,并使用多个numberHiddenLayers值对其进行训练.使用优于其他模型的模型可获得最佳值,从而优化numberHiddenLayers变量.

However, this does not mean that numberHiddenLayers is not trainable at all, it only means that in this model and its implementation we are unable to do so. We could make numberHiddenLayers trainable; the easiest way would be to define another ML algorithm that takes this model as input and trains it with several values of numberHiddenLayers. The best value is obtained with the model that outperformed the others, thus optimizing the numberHiddenLayers variable.

换句话说,模型的不可训练参数是您在训练期间不会进行更新和优化的参数,必须事先定义或作为输入传递.

In other words, non-trainable parameters of a model are those that you will not be updating and optimized during training, and that have to be defined a priori, or passed as inputs.

这篇关于不可训练参数的定义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆