Deutsch   English   Français   Italiano  
<v8rk3b$154kc$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: BGB-Alt <bohannonindustriesllc@gmail.com>
Newsgroups: comp.arch
Subject: Re: Misc: Applications of small floating point formats.
Date: Mon, 5 Aug 2024 17:35:22 -0500
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <v8rk3b$154kc$1@dont-email.me>
References: <v8ehgr$1q8sr$1@dont-email.me>
 <61e1f6f5f04ad043966b326d99e38928@www.novabbs.org>
 <v8ktu7$3d24l$1@dont-email.me> <v8m6an$3kkjg$1@dont-email.me>
 <h0v1bjlqmqab7gvaudpv93h0cr59pk8t49@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 06 Aug 2024 00:35:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6d985a6fe48e2a46e74e9f2b5af768ca";
	logging-data="1217164"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18cMYwaTXlUNAn+yuFoSV5LWrkpmKLomqM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DrrPm+0dh48J1h9C3BJD0gFnpOM=
In-Reply-To: <h0v1bjlqmqab7gvaudpv93h0cr59pk8t49@4ax.com>
Content-Language: en-US
Bytes: 3605

On 8/5/2024 11:24 AM, George Neuner wrote:
> On 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).

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).

....