Jump to content

Photo

My TI 99/4A doing medical research!


5 replies to this topic

#1 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,459 posts
  • Location:Eagan, MN, USA

Posted Sat Jun 2, 2018 4:51 PM

Nothing beats XB for a rapid check on an algorithm, at least for me, so when I started a research project on pediatric croup, my TI was super useful.

 

Quick background: 75% of admissions for pediatric croup are unnecessary in the US, a huge waste of healthcare dollars and an unnecessary burden on the child and family. I started a research project about a year ago trying to come up with a risk calculator that could predict with reasonable accuracy whether any particular croup patients required admission. Data collection was completed a couple of months ago but extensive statistical analysis has failed to produce strong associations between patient characteristics and need for admission, possibly hindered by the fact that only 117 patients in my hospital pool met research inclusion criteria. So I decided to test out a neural network to see if I could tease out hidden associations beyond the realm of statistics.

 

I started out with programs on the TI in XB initially with a simple 1 neuron perceptron which failed spectacularly (80+ % error rate), then moving on to a much more involved neural net with 2 medial synaptic layers and backpropagation which was much more promising (30% error rate). Since neural networks require a large number of trials to converge on a solution, I just had the program process the same dataset repeatedly to simulate that. Yes I know that this is still a high error rate, but it's still better than the 75% currently in the medical community! Essentially my TI experimentations provided the needed reassurance that my algorithms were working, although implementation was severely limited by available memory (I could only do 25 neurons per synaptic layer) and numeric precision (the Fermi function used to normalize the data and it's reverse function used in backpropagation could produce very small and very large numbers and I kept bumping into overflow errors). Therefore I fully expect much better error rates on a modern computer, and I'm currently working on creating a javascript program for that purpose.

 

Who said the TI was obsolete?  :D

 

For the curious, here's the neural net program in its current state:

 

Spoiler


#2 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 826 posts
  • Location:The Great White North

Posted Sat Jun 2, 2018 5:57 PM

If you were getting overflow errors on the TI then you could still get them on a modern computer depending on the floating point data size.

The TI-99 can handle a mantissa to 127 so it's pretty big.

 

This is really cool work.  Are you an MD?



#3 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 826 posts
  • Location:The Great White North

Posted Sat Jun 2, 2018 5:58 PM

Also, would be able to save some size by reading your DATA from an input file to make more room for the neuron layers?



#4 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,846 posts
  • Location:Silver Run, Maryland

Posted Sat Jun 2, 2018 6:06 PM

I have not carefully analyzed what you are doing mathematically and you may already be doing this, but, if you are dealing with summations of very large and very small numbers in the same summation, it is best , if possible, to order the addends from smallest to largest to minimize truncation errors.  It may even be necessary to compartmentalize calculations for very small and very large terms until the end of the process.  I had to do something like this in fitting ethanol-water composition/density data to a polynomial because the critical parts of the coefficients often required more digits of precision than were available in the C program package I was using (MS Visual C++ circa 2006 or so).  This was due to the fitting equations depending on very small differences in very large numbers.  What I did was to split the coefficients into high and low parts, thus doubling the number of terms, and summing the smallest terms first.

 

...lee



#5 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,459 posts
  • Location:Eagan, MN, USA

Posted Sat Jun 2, 2018 6:17 PM

Yes I'm an MD. Javascript arithmetic is double-precision floating point on a modern PC, i.e. numbers between 10E-308 and 10+E308 can be represented, much larger than the TI. I'm hoping this will minimize the overflow errors issue.
As for the data format, I could indeed have it on disk but it will slow things down significantly. Even as things stand it is painfully slow and requires Classic99 in overdrive mode to run marginally well. Besides, the savings in memory achieved will allow for only a handful of extra neurons per layer at best, which will have negligible impact on the results. I'm planning on having at least 150-200 neurons per medial synaptic layer with javascript, maybe more depending on my ultimate results.

#6 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,459 posts
  • Location:Eagan, MN, USA

Posted Sat Jun 2, 2018 6:31 PM

I have not carefully analyzed what you are doing mathematically and you may already be doing this, but, if you are dealing with summations of very large and very small numbers in the same summation, it is best , if possible, to order the addends from smallest to largest to minimize truncation errors.  It may even be necessary to compartmentalize calculations for very small and very large terms until the end of the process.  I had to do something like this in fitting ethanol-water composition/density data to a polynomial because the critical parts of the coefficients often required more digits of precision than were available in the C program package I was using (MS Visual C++ circa 2006 or so).  This was due to the fitting equations depending on very small differences in very large numbers.  What I did was to split the coefficients into high and low parts, thus doubling the number of terms, and summing the smallest terms first.
 
...lee


Ordering the addition terms will certainly be feasible but with a larger number of neurons, say 200 per medial synaptic layer, we are looking at 40000 terms for each of the medial layers, and I'm not sure what kind of performance hit this will generate. I might consider it if the error rate remains high. The same goes for compatmentalization. Great trick though!
Thinking about this a bit more though, my experimentation on the TI showed that very small intermediate numbers are generated during forward propagation, and conversely very large ones during back-propagation, so ordering might not be very helpful in this situation...




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users