The MASM Forum

General => The Laboratory => Topic started by: K_F on May 24, 2016, 08:02:51 PM

Title: Creating your own Arnie (AI)
Post by: K_F on May 24, 2016, 08:02:51 PM
As i move onto the next phase of my proggie... Artificial Intelligence exciting stuff
Starting with these structures...
It starts looking like COM in a way, but I'm adding some flexibility into the structures.. such as per-synapses/feedback input/output functions, ability to change synapses connections in th learning process, expand/shrink the synapses tables..etc

I (we  :biggrin:) could get out of control here.. :badgrin:

.Const

;--- Level Type constants ----------
LevelTypeNothing equ 0 ;
LevelTypeDataInput equ 1 ; Input only level (Interface to data Inputs)
LevelTypeInputOutput equ 2 ; Mid levels
LevelTypeOutPut equ 3 ; Output only
LevelTypeReqOutPut equ 4 ; Desired output (use for teaching)

;--- Synapsis Type constants ----------
; (Thinking about this)

;--- More stuff later ---

.Data?

.Data
AI_Module Struct ; 2048 bytes
AI_FileName DB 512 DUP(0) ; AI Strucutre file
AI_IniFileName DB 512 DUP(0) ; Initial values file
AI_Description DB 512 DUP(0) ; Module Description
AI_FileHandle DD 0 ; Structure file handle
AI_IniFileHandle DD 0 ; Initial file handle
AI_NumLevels DD 0 ; Number of levels
AI_ptrLevelTable DD 0 ; Level table ptr
AI_Dummy DB 496 DUP (0) ; Extra space
AI_Module Ends

AI_Level Struct ; 128 bytes
LVL_Name DB 104 DUP (0) ; Short name description
LVL_ID DD 0 ; ID This Level
LVL_Type DD 0 ; Level Type
LVL_SynCount DD 0 ; Synapsis Count
LVL_ptrSynTable DD 0 ; Synapsis Table ptr
LVL_Dummy1 DD 0 ; Make a Gap
LVL_Dummy2 DD 0 ;
AI_Level Ends

AI_Synapsis Struct ; 128 bytes
SYN_Name DB 64 DUP (0) ; Short name description
SYN_ID DD 0 ; ID this synapsis
SYN_Type DD 0 ; Synapsis Type (whos knows ?)
SYN_IPValCnt DD 0 ; Number of Input Values and weights
SYN_IPFBCnt DD 0 ; Number of Input Feedback values and weights
SYN_OPValCnt DD 0 ; Number of Output values
SYN_OPFBCnt DD 0 ; Number of Output feedback values

SYN_ptrIPValTbl DD 0 ; Synapsis Input/Output table ptrs
SYN_ptrIPFBTbl DD 0 ;
SYN_ptrOPValTbl DD 0 ;
SYN_ptrOPFBTbl DD 0 ;

SYN_Bias REAL8 0.0 ; Shift between {-1,1]
SYN_CalcValue REAL8 0.0 ; Calculated value
SYN_Dummy1 DD 0 ; Make a Gap
SYN_Dummy2 DD 0 ;
AI_Synapsis Ends ;


INPUTValue Struct ; 32 Bytes
IPV_Function DD 0 ; The Value to Weight function
IPV_Value REAL8 0.0 ; Input value
IPV_Weight REAL8 0.0 ; Weight value
IPV_Dummy1 DD 0 ; Sluurp sluurp
IPV_Dummy2 DD 0 ;
IPV_Dummy3 DD 0 ;
INPUTValue Ends

INPUTFeedBack Struct ; 32 Bytes
IFB_Function DD 0 ; The Value to Weight function
IFB_Value REAL8 0 ; Input value
IFB_Weight Real8 0 ; Weight value
IFB_Dummy1 DD 0 ; Sluurp sluurp
IFB_Dummy2 DD 0 ;
IFB_Dummy3 DD 0 ;
INPUTFeedBack Ends

OUTPUTSynapsis Struct ; 32 Bytes
OSYN_Function DD 0 ; Function to perform on output
OSYN_LVL DD 0 ; Destination level
OSYN_Syn DD 0 ; Destination synapsis
OSYN_SynPtr DD 0 ; Destination synapsis pointer
OSYN_Dummy1 DD 0 ; Sluurp
OSYN_Dummy2 DD 0 ;
OSYN_Dummy3 DD 0 ;
OSYN_Dummy4 DD 0 ;
OUTPUTSynapsis Ends

OUTPUTFeedBack Struct ; 32 Bytes
OFB_Function DD 0 ; Function to perform on output
OFB_LVL DD 0 ; Destination level
OFB_Syn DD 0 ; Destination synapsis
OFB_SynPtr DD 0 ; Destination synapsis pointer
OFB_Dummy1 DD 0 ; Sluurp
OFB_Dummy2 DD 0 ;
OFB_Dummy3 DD 0 ;
OFB_Dummy4 DD 0 ;
OUTPUTFeedBack Ends

;;==============================================================================
;; PROTOTYPE ARTIFICIAL INTELLIGENCE MODULE
;;==============================================================================
;AI_Module::
;Name=
;Levels=

;Levels::
;{
; Level_0:
; {
; Name=
; ID=
; TYPE=
; SynapsisCount=

; INPUT_SYNAPSIS::
; {
; Synapsis_0:
; {
; Name=
; ID=
; TYPE=
; Bias=
; Value=
; IPValCount=
; IPFBCount=
; OPValCount=
; OPFBCount=

; INPUT_VALUES::
; {
; IPVal_0:
; {
; Function=
; Val=
; Wht=
; }
; .
; .
; IPVal_n
; {
; }
; }

; INPUT_FEEDBACKS::
; {
; IPFB_0:
; {
; Function=
; Val=
; Wght=
; }
; .
; .
; IPFB_n:
; {
; }
; }

; OUTPUT_SYNAPSIS::
; {
; OPSYN_0:
; {
; Function=
; DestinationLevel=
; DestinationSyn=
; }
;
; .
; .
; OPSYN_n:
; {
; }
; }

; OUTPUT_FEEDBACKS::
; {
; OPFB_0:
; {
; Function=
; DestinationLevel=
; DestinationSyn=
; }
; .
; .
; OPFB_n:
; {
; }
; }
; }
; .
; .
; Synapsis_n:
; {
; }
; }
; }
; .
; .
; Level_n:
; {
; }
;]

Title: Re: Creating your own Arnie (AI)
Post by: anunitu on May 24, 2016, 08:14:10 PM
This does seem to be the next step these days..if you can do it,more power to you.
Title: Re: Creating your own Arnie (AI)
Post by: FORTRANS on May 24, 2016, 11:12:58 PM
Hi,

   Not sure if this is of any interest, but...  The current issue of
the magazine "Scientific American", June 2016, has a section (3
articles and a splash page) on artificial intelligence (AI).  The first
is 'Machines Who Learn'.  The second is 'The Truth about
"Self-Driving Cars"'.  And the third is 'Should We Fear Supersmart
Robots?'.  {Who?}

Regards,

Steve N.
Title: Re: Creating your own Arnie (AI)
Post by: anunitu on May 25, 2016, 12:18:54 AM
Terminator or bust? I vote for Robbie or R2D2
Title: Re: Creating your own Arnie (AI)
Post by: rrr314159 on May 25, 2016, 02:17:29 AM
Machines are getting more "intelligent" all the time, but will they ever do what humans can do - including creativity, humor, intuition, so forth? Can they ever come up with new ideas, as opposed to merely recycling old ones? Maybe, but they're certainly not there yet. Kurzweil predicts "real" AI by 2029; with luck, I'll find out if he's right.
Title: Re: Creating your own Arnie (AI)
Post by: hutch-- on May 25, 2016, 09:52:22 AM
I am much of the view that computer CAN produce artificial intelligence but they will never produce intelligence. Already computer programming can do a number of things based on logic and with a combination of logic and data storage the result can often be useful and sound intelligent but it will never be original as it required a human to write it in the first place. Now predictably in the future as well as the present computer aided software design will improve the capacity of artificial intelligence and bigger better faster and more powerful computer hardware will also extend this capacity but it simply does not have the input sources that humans have.
Title: Re: Creating your own Arnie (AI)
Post by: rrr314159 on May 25, 2016, 12:32:04 PM
Quote from: hutch-- on May 25, 2016, 09:52:22 AM...never...

- Never say never!
Title: Re: Creating your own Arnie (AI)
Post by: Raistlin on May 25, 2016, 04:06:30 PM
Bill Gates: "640K ought to be enough for anybody"
Title: Re: Creating your own Arnie (AI)
Post by: anta40 on May 25, 2016, 05:18:57 PM
Quote from: rrr314159 on May 25, 2016, 02:17:29 AM
but will they ever do what humans can do - including creativity, humor, intuition, so forth?

Maybe one day we have a neural network model which can handle these issues...

:P
Title: Re: Creating your own Arnie (AI)
Post by: xanatose on May 25, 2016, 05:55:38 PM
Quote from: hutch-- on May 25, 2016, 09:52:22 AM
I am much of the view that computer CAN produce artificial intelligence but they will never produce intelligence. Already computer programming can do a number of things based on logic and with a combination of logic and data storage the result can often be useful and sound intelligent but it will never be original as it required a human to write it in the first place. Now predictably in the future as well as the present computer aided software design will improve the capacity of artificial intelligence and bigger better faster and more powerful computer hardware will also extend this capacity but it simply does not have the input sources that humans have.
I guess that what depend on what one defines intelligence to be.

If is gathering of information on a predetermined way? then the computer will surpass us.

However wisdom is something more difficult to achieve.

Should it be IQ, then the computer will win, as IQ is based on predetermined tests.

Should if be inventions (aka seeing the same thing everyone else has seeing but thinking a different thing that makes something new) then humans will continue to win.

As stated it will dependent of what intelligence is.
Title: Re: Creating your own Arnie (AI)
Post by: hutch-- on May 25, 2016, 08:13:53 PM
The factor that stay with me is the input range of human beings. Visual, auditory, tactile, linguistically, olfactory and abstractions based on all of these over a lifetime of experience make for a truly massive range of informational input and this would be extremely difficult to duplicate on a computer system. This is why I draw a distinction between AI versus I. Computers will regurgitate data far faster than humans ever will and can access truly massive ranges of known data but humans can laterally think, make guesses that can be tested (hypothetico deductive spiral), draw from any combination of a massive range of inputs and keep- tweaking it until it fits.
Title: Re: Creating your own Arnie (AI)
Post by: anunitu on May 25, 2016, 08:57:52 PM
There is work being done on Organic computing,so it just might be possible to create what Asimov called a Positronic brain in his SF.

And Darpa is on the case for real.
https://kryptonradio.com/2013/07/17/darpa-working-on-sentient-robots-with-positronic-robot-brains/

"DARPA Working on Sentient Robots With "Positronic" Brains"
Title: Re: Creating your own Arnie (AI)
Post by: rrr314159 on May 26, 2016, 02:04:49 AM
anunitu, it's true there may be a new techology like "positronic brains" which will make real computer intelligence (which, I think, entails consciousness) possible. hutch is talking about traditional digital computers; unknown breakthroughs can't really be discussed until they're known.

The technology that article presents has absolutely nothing to do with positrons, BTW. It sort of models a brain's connections with synaptic wires. In a way, the big "new" thing about it is: it's partly analog! Recycling old and discredited models is often a good way to make progress.

I still say, a traditional digital computer may be capable of "creativity", "lateral thinking", "imagination" or whatever you want to call it. At least, it may fake it so well you can't tell the difference. In that case, quite possibly we will be able to tell the difference, but only after decades, when society stagnates due to dependence on  the pseudo-thinking machines. Young, brave humans will have to fight a desperate revolution to regain control of their lives and futures, forging ahead to new horizons of thought, mastery of the universe, and stuff like that. Hmmm ... if the hero gets the girl as well, that would make a great plot for a movie!
Title: Re: Creating your own Arnie (AI)
Post by: anunitu on May 26, 2016, 02:13:42 AM
Being that I will most likely not be around to see this "Classic" plot play out,these days the hero might not get the girl,he might get the guy...times change as we have seen over the last 50 years...Or the hero might be a Woman...
Title: Re: Creating your own Arnie (AI)
Post by: K_F on May 26, 2016, 03:23:24 PM
I've completely changed the model (in my head that is :badgrin:), to give it more flexibility and ease of programming.
It just takes up a lot of memory... 4 levels of 2048 synapses each, takes up 756MBytes.  :shock:
I don't expect the prototypes to get that large but using it anyway.
Now to do the keyboard dance..  :greensml:
Title: Re: Creating your own Arnie (AI)
Post by: rrr314159 on May 26, 2016, 06:01:42 PM
Just think, K_F, you'll never have to "do the keyboard dance" again! Once this works, it will do the programming for you. Your job will be to drink a cold beer, and wonder what the heck to do with all that free time. :-)
Title: Re: Creating your own Arnie (AI)
Post by: K_F on May 27, 2016, 12:27:46 AM
 :biggrin:
Nah.. never let a computer rule my life... do the number crunching, yes.. but it must remain dumb.
Besides I enjoy tapping away..

Beer... Funny enough I get my most 'innovative waves'  from the first 3 wine glasses (first 4 beers).. after that the brain turns to mush so I have to type/write it all in during that time.. other places include the 'throne' and the shower. The rest of the time is brainlessly pushing a mouse around.
:t
Title: Re: Creating your own Arnie (AI)
Post by: mineiro on May 30, 2016, 09:52:51 AM
I'm a skeptical about A.I.
If we think about kernel at human level, we need evolute a lot. What we have really evoluted?
1- know how to draw symbols
2-know how to phonetically represent symbols
3-know how to count
4-know how to phonetically represent counts

If an A.I. can teach us only one more step I will put my head down as a sign of respect.
Title: Re: Creating your own Arnie (AI)
Post by: anunitu on May 30, 2016, 04:32:46 PM
One thing AI's can not do is feel empathy,but then again it seems not as many humans as you would think also feel empathy. :icon_rolleyes: 
Title: Re: Creating your own Arnie (AI)
Post by: xanatose on June 02, 2016, 11:56:01 PM
Quote from: anunitu on May 30, 2016, 04:32:46 PM
One thing AI's can not do is feel empathy,but then again it seems not as many humans as you would think also feel empathy. :icon_rolleyes:
What is empathy but being able to put yourself on another person situation (aka imagination). If the AI is fast enough, it may be able to simulate the other being situation thus have a greater understanding of it.

So if computers ever become intelligent, good luck with that, they might also be able to have empathy. Of course that would be after their kill all humans phase.   :badgrin:
Title: Re: Creating your own Arnie (AI)
Post by: mineiro on June 03, 2016, 12:29:55 AM
An A.I. can read human body, like looking down is thinking, looking up is dreaming, crossed arms is insatisfied, foot direction is attention, ... . Into this sense empathy can be read.
Computers can calculate serial things quickly than us, but if you put paralel things we win, like Kasparov vs deep blue.
It's like to define a function to love, we can feel but cannot prove this as math way.
I'm remembering of liberal arts, to say:  Grammar, logic, rhetoric,  arithmetic, geometry, music and astronomy, this A.I. can do,but what about virtues: understanding, science, wisdom, prudence and art.
A raw translation:
understanding is intuitive grasp of first principles ( logical thinking and logical investigation ) ; science is the knowledge of the most likely causes; wisdom is the understanding of the fundamental causes said ; prudence is coherent thought regarding the actions and, finally , art is the thought applied to the production and the ability to produce.

Some A.I. can reproduce a paint of a GrandMaster, or paint like it, but I think that they cannot feel, like intuition.

I don't like to discourage this topic, I have played only a bit with A.I., and give to me some mental libido.
Title: Re: Creating your own Arnie (AI)
Post by: mineiro on June 03, 2016, 02:08:42 AM
I don't like to say only on a philosophical way, I like to show real examples.
What's information? Information is data interpretation.

So, what's a .com program? Just a raw dump, on runtime have a frame but .com do not have headers.
What's an image like .gif, .jpg, .bmp? A raw dump encapsuled with some header.
What's a sound like .wav, .mp3? A raw dump encapsuled with some header.
What's this text? A raw dump with some header and formatting.

So, we can listen a program, execute a text, listen an image and see sounds.
The keyword is raw, on computers are raw bytes.

Paint shop pro, photoshop, gimp can open .gif files (lossless) and export as a raw dump file.
Audacity can import this raw file and echo sound on speaker.
To you see a sound file you must think in rectangles, so if filesize cannot be factored, you must include more data.
I forgot the name of a program to ms-dos that can convert .com files to an executable text file. If you open you only see ascii chars, but if you rename it you have a fully functional program.

We can create sounds, pictures, texts by using an assembler. And, why not, we can code in assembler using an image editor (opcodes on mind), colors are opcodes.

My first post on old forum was a program painted with pen on a paper only using squares. So if you scan, transform blue squares to one and white
squares to zero, join that to bytes, you have a .com program. Now, if you burn/cut only a single square (bit) you changed a jz to a jnz and
the program will echo other string.

If we have only raw dump of data, of an image per example, we cannot say whats that but we can feel about that.
Title: Re: Creating your own Arnie (AI)
Post by: hutch-- on June 03, 2016, 04:09:10 AM
 :biggrin:

> I forgot the name of a program to ms-dos that can convert .com files to an executable text file. If you open you only see ascii chars, but if you rename it you have a fully functional program.

This is easy enough to do in Win32, you append the text file at the end of a simple console Win32 app that reads from the start of the text up to a terminating zero. If you are a purist you can alter the PE header so the file length encapsulates the appended text.
Title: Re: Creating your own Arnie (AI)
Post by: anunitu on June 03, 2016, 06:29:37 AM
I remember those files,they were popular as kind of dos executable help files,that or they did a bat file and used the old list program to view text files. There was also a program to turn a bat file into an .exe or .Com.
Title: Re: Creating your own Arnie (AI)
Post by: mineiro on June 03, 2016, 07:25:57 AM
Yes, I agree, like inserting a .rar file inside .gif file, just concatenate it after ";"(gif eof),  but I do not express myself in the way that I like.
I'm really talking about text, the guy that created that program have done all using a limited char set (instructions) to play.
Like this: you code a program to encode/decode a .com file, but you have only tab, cr, lf, and space(20h) to 7eh. So, we cannot have nop per example.
The output appears like uuencode/uudecode strings, but you can execute that text.
Well, you can change that program by using a notepad or ms-dos edit but not console/gui pe applications, because these new editors "eat" zeros.
I do not understand the real intention about these type of program, maybe bypass av and firewall because are strings, not sure.
Texts are easy, just put backspace (08h) as much you need and you can have more than 1 text inside other.
Title: Re: Creating your own Arnie (AI)
Post by: mineiro on June 06, 2016, 05:10:07 AM
And about creativity or imagination.
We can use a program to other needs, an A.I. can do the same?
Radasm IDE can be a recipe book, have snippets, we can create projects of different types.
On my country we call this "gambiarra", I do not know the translation to this word, if you like to smile a bit today, search by photos/images on search engine with this word.