Liste des Groupes | Revenir à c arch |
On Mon, 5 Aug 2024 17:35:22 -0500, BGB-AltYeah.
<bohannonindustriesllc@gmail.com> wrote:
On 8/5/2024 11:24 AM, George Neuner wrote:You can use more precision in the mantissa, or more range in theOn Sat, 3 Aug 2024 21:09:43 -0000 (UTC), Lawrence D'Oliveiro>
<ldo@nz.invalid> wrote:
>On Sat, 3 Aug 2024 11:40:23 +0200, Terje Mathisen wrote:>
>MitchAlsup1 wrote:>
>So, you have identified the problem:: 8-bits contains insufficient>
exponent and fraction widths to be considered standard format. Thus, in
order to utilize 8-bit FP one needs several incarnations.
This just points back at the problem:: FP needs at least 10 bits.
I agree that fp10 is probably the shortest sane/useful version, but
1:3:4 does in fact contain enough exponent and mantissa bits to be
considered an ieee754 format.
The AI folks are quite happy with 8-bit floats for many applications. In
fact, they prefer more exponent bits and fewer in the mantissa.
Insufficient precision is one of the many reasons that ANNs are prone
to hallucinate.
Also likely depends on the type of NN as well.
>
As noted, for some of the stuff I had tried doing, there was a
noticeable detrimental effect with fewer than around 8 to 10 bits in the
mantissa for the accumulator. Weights and biases could use fewer bits
(as could the inputs/outputs between layers), but not so much the
accumulator.
>
Whereas, large exponent ranges tended to be much less of a factor
(though with training via genetic algos, it was needed to detect and
handle some cases where values went outside of a "reasonable" exponent
range, such as E+14 or so).
exponent ... generally you don't need both ;-) ... but in either you
do need *enough* bits.
The problem with 8-bit reals is they have neither enough precision nor
enough range - they too easily can be saturated during training, and
even if the values are (re)normalized afterward, the damage already
has been done.
16-bit values seem to enough for many uses. It does not matter much
how the bits are split mantissa vs exponent ... what matters is having
enough relevant (to the algorithm) bits to avoid values being
saturated during training.
One other thing I had found was that it was possible to DC-bias the
inputs (before multiplying against the weight), but the gains were small.
>
>
So, say, for each input:
(In+InBias)*Weight
Then, output:
OutFunc(Accum*OutGain+OutBias)
>
Though, OutGain is also debatable (as is InBias), but both seem to help
slightly. Theoretically, they are unnecessary as far as the math goes
(and what gains they offer are more likely a product of numerical
precision and the training process).
>
Will note that for transfer functions, I have tended to use one of:
SQRT: (x>0)?sqrt(x):0
ReLU: (x>0)?x:0
SSQRT: (x>0)?sqrt(x):-sqrt(-x)
Heaviside: (x>0)?1:0
>
While tanh is traditionally popular, it had little obvious advantage
over SSQRT and lacks a cheap approximation (and numerical accuracy
doesn't really matter here).
>
...
>
Les messages affichés proviennent d'usenet.