Post Reply 
General challenge for site members
06-22-2024, 12:07 PM (This post was last modified: 06-22-2024 12:11 PM by Maximilian Hohmann.)
Post: #8
RE: General challenge for site members
Hello,

or a simple neural network?

Please write a program for the hp-71b based on a neural network to predict results in the British premier league from previous games

Answer: Creating a neural network on an HP-71B is quite challenging due to its limited computational resources and memory. The HP-71B is a vintage calculator/computer from the 1980s with a BASIC-like language, and it was not designed for complex tasks like neural networks. However, I'll provide a simplified version of a program that could predict outcomes based on some basic statistics, which might give you a rough idea.

... AI generated statistics based program omitted ...

Next question: „Thank you, assume that the hp-71b has 64kBytes of RAM extension, would a neural network solution be feasible

Answer: Even with 64KB of RAM, implementing a neural network on the HP-71B would be challenging due to its processing power and limitations in handling complex arithmetic operations efficiently. However, a very simple neural network might be feasible, especially if you restrict the network size and training data. Here is an attempt at a basic neural network implementation for predicting outcomes in the British Premier League.
...
Implementing even a simple neural network on the HP-71B is an educational exercise in understanding the limitations of vintage hardware and how computational constraints shape the design of algorithms. For practical purposes, more modern hardware and software environments are recommended for machine learning tasks.

... more detailed explanations omitted ...

So here it is, the neural network for predicting football results:
Code:
10 DIM W(2), X(2), Y(2)
20 INPUT "NUMBER OF TEAMS: "; N
30 DIM TEAMS$(N), GAMES(N,2)
40 FOR I = 1 TO N
50   INPUT "TEAM NAME: "; TEAMS$(I)
60   INPUT "GOALS SCORED: "; GAMES(I,1)
70   INPUT "GOALS CONCEDED: "; GAMES(I,2)
80 NEXT I
90 INPUT "HOME TEAM: "; HOME$
100 INPUT "AWAY TEAM: "; AWAY$
110 FOR I = 1 TO N
120   IF TEAMS$(I) = HOME$ THEN H = I
130   IF TEAMS$(I) = AWAY$ THEN A = I
140 NEXT I
150 REM Initialize weights
160 W(1) = 0.5
170 W(2) = 0.5
180 REM Set learning rate
190 L = 0.01
200 REM Training loop
210 FOR E = 1 TO 1000
220   FOR I = 1 TO N
230     X(1) = GAMES(I,1)
240     X(2) = GAMES(I,2)
250     TARGET = X(1) - X(2)
260     PRED = W(1) * X(1) + W(2) * X(2)
270     ERROR = TARGET - PRED
280     W(1) = W(1) + L * ERROR * X(1)
290     W(2) = W(2) + L * ERROR * X(2)
300   NEXT I
310 NEXT E
320 REM Prediction
330 X(1) = GAMES(H,1) + GAMES(A,1)
340 X(2) = GAMES(H,2) + GAMES(A,2)
350 PRED = W(1) * X(1) + W(2) * X(2)
360 PRINT "PREDICTED RESULT: "; PRED
370 END

Unfortunately I have no way of transfering this code from my Macintosh to the HP-71B other than typing it in (which is what I would have done 40 years ago but these days are over) to see how well it ppredicts.

Regards
Max

NB: Just out of curiosity, I asked one more question: „Could you squeeze in a second layer of the neural network if the RAM were exteded to 128kB?

Answer: With 128KB of RAM, it is more feasible to implement a small neural network with a second layer on the HP-71B. However, the HP-71B's processing power is still quite limited, so the network will have to remain very simple. We can add a hidden layer to the neural network with a few neurons.

The resulting program is quite long and would really be interesting to try out...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
General challenge for site members - Namir - 06-21-2024, 03:54 PM
RE: General challenge for site members - Maximilian Hohmann - 06-22-2024 12:07 PM



User(s) browsing this thread: 2 Guest(s)