Wednesday 26 December 2018

Stream Amazon Prime over your Ubuntu Linux network

Wow so you've decided to stream your music now and MPD is useless
Amazon prime has all your albums and its affordable but so far you can only
listen via your browser or phone. You want it streamed throughout your
home network to every machine you own just like mpd.

Heres how to do it using vlc :
1. Open a browser on your Ubuntu box and start streaming music to your soundcard.

2. Issue this command on your Ubuntu box to find out what sound device to use:
pacmd list-sources | awk '/name:.+\.monitor/'

3.  Then add this information to the following cvlc command:

cvlc pulse://alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --sout '#standard{access=http,mux=ogg,dst=you.ripa.dre.ss:8080}'

4. Open http://you.ripa.dre.ss:8080 on any of your other machines to stream
directly from your amazon prime music! Yeah.

And it works and now you can listen your Music just like with MPD.

Thursday 29 November 2018

Seed Recall

Ok so its time to fess up about what Ive discovered. OMG. Seed recall is a discovery I made whilst experimenting with the RLnet - Neural Q Learner.

I noticed that the solution depened on the random seed. So I decided to test the theory that the randomly perturbed activation functions themselves encoded different solutions (and heres the big one) for the same prelearnt weights.

Heres what I did:

Learning:
seed random generator
init random weights or load previous weights
create seed during learning - using Random Decay (See previous post)
backpropogate solution 178 iterations
save seed
save weights

repeat for all solutions

Recall:
set random generator to null
load saved weights
load seed for solution - Apply seed directly to Activation function
backpropogate        58 iterations
view seed dependant solution

For each seed I got a unique solution. Ofcourse its early days but it may just be that different solutions to the same problem can be learnt and encoded by the same neural network using the different random seeds applied to the activation function for each neuron.

Whether this extends to other problems I have yet to discover. If the problems are similar and have the same dimensions then it is possible.

The problem I am using is that detailed in previous posts:

{{-1, -1, -1,-1,  0,-1},
            {-1, -1, -1, 0, -1, 1},
            {-1, -1, -1, 0, -1,-1},
            {-1,  0, -1,-1,  0,-1},
            {-1, -1, -1, 0, -1, 1},
            {-1,  0, -1,-1,  0, 1}};
6 States with 6 Actions

I now plan to Upscale the RLnet to do 120x120 and use a CNN layer.





Cumin Tikka

Invented new dish calling it CuminTikka. Marinade chicken in yoghurt, cumin,corriander,paprika,garam masala, ginger and garlic. Overnight.
Roast chicken marinades.( Or You can just add the Marinades without cooking them)
Add cumin 2tsp, freshly chopped mint to onions cook down.
Brown blanched potatoes with butter,herbs and garlic.
Add tomatoe to onions, add stock, and lemon juice.
Add all to sauce and then to casserole.
It is very refreshing the cumin, mint and lemon sauce is delicious and fresh, the marinades are spicey and fun.
CuminTikka.

You can roast the marinades and then add them, or add them without roasting or frying. The flavour locks into the chicken from the marinade. Even with adding marinade to the sauce the lovely fresh taste of the cumin-mint still comes through.

Monday 19 November 2018

Finally the Quest for the Holy grail of (My)AI is nearly over...

Since 2007 I had begun a quest to train a neural network to learn
the Bellman Residual - the equation used in Reinforcement Learning (Q learning).

As the years went by Deep Learning took over the quest and completed it (and some!!).

However the Quest was still ellusive to me and so I went off and did something else with my spare time.

But recently I returned to the quest. I dry docked an MLP neural network and benchmarked it on Xor. Then I set about applying it to the problem specified here:

 {{-1, -1, -1, -1, 0, -1},
            {-1, -1, -1, 0, -1, 1},
            {-1, -1, -1, 0, -1, -1},
            {-1, 0, -1, -1, 0, -1},
            {-1, -1, -1, 0, -1, 1},
            {-1, 0, -1, -1, 0, 1}};

Each of the 6 array above is a state with 6 actions. It is a Qlearning problem used by Mnemstudio.

So as you may have read in a previous blog I tried using Mnemstudio's XOR Backpropogating Neural Network. But alas I knew it needed another layer.

I tried adding another hidden layer, a CNN layer all to no avail. Until I rewrote it completely and applied my own learning rules.

I also cheated and used a RANDOM DECAY routine that decreased with Error. That means that while it learnt its TRANSFER FUNCTION was slightly random meaning that it could jump out of SUBOPTIMAL SOLUTIONS and find new ones.

With 4 layers : INPUT 6 X NEURONS WITH NORMALISED DATA
                        OUTPUT 6 X NEURONS WITH SIGMOID ACTIVATIONS
HIDDEN LAYERS X 2 WITH 18 NEURONS WITH TANH AND SIGMOID

For this algo the CNN option doesnt help for this problem however I am hoping it will work on Pixel to action problems. (Where the input is a image and the output is an action)

What was interesting is that the neural network converges to different solutions where as the Q learner stays in one solution - which I think is the purpose of using a Neural Network for RL. Its power is that it can find solutions where the Q learner cannot.

Q test output
1, 5
3, 4, 5
5, 5
2, 3, 4, 5
4, 5
0, 4, 5
Q Neural test output
1, 5
3, 1, 5
5, 4, 5
2, 3, 1, 5
4, 5
0, 4, 5

Two different solutions above both equally valid.


How did we get an error curve like that!!!

Sneak a peak @ Shepherds latest works DarkSide - Chapter 2 - The Watchers


Or Read Kromos now















Monday 1 October 2018

Space Builders WANTED

Which wealthy nation with a history of empire will be the first to grasp this amazing opportunity to begin building its own fleet of spaceship's in orbit around earth. Musks ambitious and genius accomplishments
have furthered the space race - a reliable falcon 9 reusable rocket that can inject people into orbit via its dragon spaceship and the falcon heavey to transport tonnes of materials into orbit (also reusable) meaning that any country could begin building an emmense spacefleet now to rival those of any other country.

Friday 3 August 2018

The Women of Mars - Prt 1 Growing Women on Mars

Growing women on mars.

The spaceship aurora entered its docking station just above fort henry. Isobel watched the greyish red planet opening out beneath her its red halo like circumference was eclipsed by the gateway staion that orbited above the martian sprawl beneath that opened out like a web of interconnected habitat's covering the equilivent land mass of the united states. Half above half below just one continuos city all made from martian soil and minerals. As she readied herself to jump from the spacecraft she held the spaceship one last time after all it had been her home for more than a year. The journey from Europa had been long and she was very tired. She would have liked to have been on the Earth shuttle it took only 3 weeks but that would have meant growing up on earth and that was only in her dreams no one from the outer planets could visit earth due to gravity and population controls.

It was generally well known that child birth by an earth woman on mars was impossible due to the lack of gravity. This had caused many problems for the colonists many of whom were family's and to discover that all births were medically impossible was a serious stumbling block for the new world. On Europa there wasnt a problem as gravity on board the Jupitor zone stations had been controlled to keep it at the right level for fetal development. On Europa if you had become impregnated then you had to make the routine trip to one of the many prenatal way stations in the Jupitor system. This often meant the parents forking out for either an abortion or paying for her stay 
upstairs until she gave birth. As gravity interferred with fetal development it was generally advised that no more than a few weeks should be left before relocation. On Mars however this wasnt possible the gravity stations around Mars were underequipped and many didnt have gravity control. The reason being – Mars was a poor planet. It was inhabited mostly by pioneers and renegades who had become obsessed with terraforming and sunk all of their money in turning Mars into earth. The gateway was all they could afford it was simply a jumping off point for arrivals who werent able to afford the earth shuttle and didnt mind free falling to a dead planet. What they saved on freefall they could use to pay for the return journey and the expensive orbital lifter which often broke down.

So unlike the Jupitor system and ofcourse earth on Mars baby's were a rarity. And no baby's meant fewer women. So most of the women came over from Earth or Jupitor attracted to the Martian experience and the Men of Mars. Who for the most part were a hardy bunch.

Mars sanitation and health department was inundated with problems that stemmed from Martian Men impregnanting their women and then the failed preganancy's and all of that mucky stuff. So they decided to make a woman from scratch that would satisfy the men on mars and be able to produce offspring.

They believed if done right they wouldnt know the difference. They were wrong. The hybrid women were unbelievably stunning they had tall athletic bodys and extremely good looks. The scientists at Mars health department couldnt understand why they were all such stunners. “Something to do with the gravity dna switch.”

Blurb :

Isobella a no nonsense girl from way out west sorts out the men of mars who dont no what to do inundated with all these femme fetals and helps the femme fetals create their own ideal men using the Mars tech for cloning hybrid humans she then goes of in search of the one man that she might faguely fancy as all the martian men fancy her but she's just not interested and heres about thisw guy whose living way out at the poles. This guy was one of the earliest pioneers before all the gruff types turned up and was obsessed with terraforming mars using some advanced technology instead he develops the ability to impregnate Isobella with this technology whose purpose was to start life on mars. Now pregnant and not sure how Isobella returns angrily to the space port to prepare for departure back to Jupitor. The shuttle fails and falls back to the planet and she is jettisoned but is rescued by a tribe of hybrid mars women who hail her as their savour. She gives birth to a normal healthy girl who is the first true woman of mars.


The Hybrid mars women have special lungs to allow them to breath on mars hence live outside and have resistance to the cold. They are also extremely beautiful and have telepathic powers to seduce any man or woman. And babies loads and loads of babies. The end.

Read More Go to juice.extramindcorp.com
Buy the book  'Seed Army' at Amazon.

Thursday 2 August 2018

SpAcE PuSH

The main reason mankind began living in space was due to congestion on earth slower net speeds meant teleportation or telepresence became almost impossible as the airwaves were
so clogged with traffic so too were the transport networks. Mankind needed space and took it as the satcom network could be used directly and ultra orbit gravity domes offered go anywhere rates for all virtual deck business men and women. They all enjoyed the emmense spaces that had been built by space grunts and telerobotics. A giant space port was first assembled and channeled precious minerals worth trillions back to earth.

In fact by the year 2089 the space race became a matter of survival when the outbreak of an information virus took hold of the entire connected human race. It was seeded two decades earlier with the advent of quantum computing. The profound effects on the pysches of every connected being on the planet due to quantum entanglement between neurons in the brain and their artificial equilivent that used electrons spinning around inside a vacume had meant the days of the super AI's on earth were numbered.

A war raged between those that wanted to surpress this new technology and those that wanted it unleashed. Unfortunately the choice had already been made as it wasnt the benign creations of the super AI's but rather the interconnectedness of man and machine that was the cause of the outbreak and mankinds dependance on these new age machines as an enhancement to his already diminished natural intelligence.

The outbreak started in various locations and spread like a virus inhabiting the minds of its users like a parasite until their brains exploded.

The cdc was called in to isolate those thought to be carriers but this had meant constructing faraday cages to stop it from travelling via the airwaves to infect others. The virus was clever though and it used quantum tunnelling to escape this.

Eventually attention was drawn to those that had remained unaffected - newborns their brains were more adaptive then those that had grown emmersed into this technological dependant world. If they were raised in a low tech environment - no phones, no radios etc then perhaps there was a chance of their brains being unaffected but it was only true for half the rest regardless of origins became infected even whilst living outside of the grid. The virus had literally hijacked our own biology at the subatomic level.

The cdc who by now had taken to wearing emf suits that scrambled the bioemmessions from the infected and that of the airwaves managed to remain unaffected there attentions now drew to the last remaining unaffected - a group of scientists who had been living in space at the time of the outbreak.

Theyd remained unaffected. Meanwhile the entire planet was now populated by the infected information virus casualtys with the countless dead whose brains had exploded due to a build up of phosphenes in the neurotransmitters reacting with an abundance of calcium ions and causing their brains to explode.

Nasa the cdc and various companys and space tech people joined forces to begin construction of a habitable space station for the survivors to escape the mind virus which by now was completely biological and didnt even need a communicatiosn infrastructure. It used the quantum computing power of interconnected minds and quantum
entanglement to spread essentially reducing those still alive to neural processing units, or quantum processors.

Luckily it was confined to earth by the ionosphere and couldnt transmit to space via any of our satellites or space ships. Once you were free of the ionosphere you could start breathing again content that you no longer had to wear emf suits and take the blockers youd been give by the cdc.


"The planet would heal...it might take years but eventually the virus would run out of human brain matter on earth and die out."

"Yes it is true that many from the cdc thought the cause was our super AI's but now we know this not to be true and the last of the remaining AI's have been rescued from earth and are now in a emf sheilded facility close to the core of this very station and their sole purpose is to monitor the earths ionosphere, cosmic radiation entering the station and ofcourse maintain our automatic gravity."

"Mr Peterson has already raised the concern that the infovirus may interact with the gravitons produced by the station and cause weightlessness but with the deadlocks in place there is no chance of this happening without a ship to ship tether being initiated.....and so far we have yet to see the virus being able to control machines."

We have theorised that the virus occured due to the initiation of quantum entanglement devices being used within the communication industry and thereby by every living being  connected to the net in someway. Once it had taken hold it no longer required a quantum device to spread and found the most suitable candidate being the human brain.

I will let Dr Andrews continue with the explanation she is the foremost epert within the cdc.

By the control of certain biochemical events the brain was made to explode due to the surplus of calcium and phosphene ions. This build up led a biochemical reaction that seemed a by product of the brain being overused for some purpose by the infovirus. We have yet to determine the purpose and have theorised that it is not soley for its procreation.

Mind fucked theyve all been mind fucked by that ... thing.

Yes leutenant Jefferies the limbic system is thought to be involved - makinds only weakness so it seems. The origins of the virus is unknown it may have been among us for thousands of years only waiting for the opportunity that our quantum meddeling has provided.


I dont think its fair to blame quantum science for this after all hasnt nature been meddling with the quantum world far longer than us.


Yes doctor philips but it was us who have opened pandoras box nature merely takes the opportunitys on offer.

Yes I agree - nature doesnt meddle it evolves it adapts just like this virus for good or for ill. Now I would like to draw our ettention to the diversity program that doctor johnson has agreed to head up.

Dr johanson a tall slim dark haired swedish woman of appealing features which drew the attention of all the male attendee's began to talk, "We have elected a team to return to earth in order to recover the dna from all persons so that they may be cloned later. and also to look for any survivors that may have some immunity to the virus."

Thankyou dr johanson. The cloning ofcourse shall be initiated once our ships arrive on hibli 8 the third planet in the Iridia system. H8 has been selected as a suitable location or hub from which humanity may spread using our dna receiver ships. They work simply by robotic control and receive and grow humans from synthetic dna. Enhanced humans that is the first created will recieve our telepathic teleportations as will our robotic servants all controlled via quantum entanglement.

Wait a minute did you say quantum entanglement - isnt that the primary mode of transmission of the infovirus.

Yes it is correct.

I see then isnt there a risk.

No no theres no risk the infovirus is perfectly contained within the earths ionosphere. No way out. Perfectly safe, nothing to worry about.

The leutenant grimaced as the scientist seemed to be hiding something. He glanced around the room no one else seemed to pick up on this. There was silver glint in the scientist's eyes only just noticeable - maybe it was just in his head. He had been overworked finishing the new wing on the habipods and being drafted to replace those that were infected back on earth.

 The controllers, the grafters all of them had been gotten to by the virus their brains were the first to go exploding over their vr decks, or on their way up in the many autoloaders that brought everything up to the station. Now they were self sufficient but only just. Everything had been stopped after the outbreak and all focus was on making sure the station was self sufficient. A few of the grafters had stayed most had returned to earth in free fall expecting to find something left of the world so they could build their own private sanctuary raise a family.

They hadnt believed the cdc their implacable faith in humanity to survive by hard work alone. Those that remained had been drafted and now formed part of an elite group of planet shifting wise guys. All of them ran their own rig's and brought resources from the inner planets back to each station enroute. But now all the focus was on the dna ships they had the best jobs and fortunatley there had been enough teleworkers plugged into the satcom's direct feeds up here to pitch in with deep space colonization. Expendable their brains often got fried in operating human clones and machines on the other side of the galaxy. Most got delinked lost somewhere in the quantum complexity's of space travel. The grafters didnt get involved they preferred their own bodys to some clone. But somebody had to do the grunt work - fetch the water, mine the ore, build the habipods.

Read More Go to juice.extramindcorp.com
Buy the book  'Seed Army' at Amazon.
















































Must remember this samba setup on ubuntu (Maybe help you with samba on linux)

samba/smb.conf

interafces = 192.168.1.0/24 wlan0 eth0
bind interfaces only = yes
security = user

;Server side:
[Resource]
   comment = user_home's Resource
   path = /home/user_home/Resource
   available = yes
   valid users = user_remote
   read only = no
   browsable = yes
   public = yes
   writable = yes

   create mask = 0755
   directory mask = 0755

(port opens automatically)

sudo adduser -m user_remote -s /bin/bash
sudo passwd user_remote
smbpasswd user_remote

command to mount client side:
sudo mount /media/Resource
sudo mount -t cifs //192.168.1.38/Resource /media/Resource -o rw,user=user_remote,uid=user_remote,gid=user_remote

Install with:
sudo apt-get install samba samba-common system-config-samba
sudo apt-get install nfs-common
sudo apt-get install cifs-utils

Friday 6 July 2018

Really REALLY simple Neural Network Reinforcement Learning

Well it was always a project I never quite finished and I found a way back in by using some well written basic scripts for AI to mix them together and make a Neural Q learner Recipe as follows:

Take one ANN for this I used the following:

http://mnemstudio.org/neural-networks-backpropagation-xor.htm

add one Q-learner from here:

http://mnemstudio.org/path-finding-q-learning-example-1.htm

and create a Neural Q-learner

1. add a new hidden layer to the ANN
2. add the complete formula for calculating the Bellman Residual to the Q-learner:

3. Create this learning loop:
i. Randomly choose a legal action (Not a wall)
ii. Connect CurrentState and Action to inputs on ANN
iii. Calculate Q using above formula
iv. Calculate Error of Q outputed from the ANN
v. Update all the weights for each layer started with the last and ending with the first - feeding back the error in the same way as the XOR problem.

4. Test the net

I found it worked best with 8 neurons in each hidden layer and the Gamma of the Bellman Equation set to 1.8 instead of 0.8

Here is the net solving the state matrix of the qlearning program:

First state=1,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=1
Found a winner
Q value=0.757337 Action=2
Final winner for state 1 =2
First state=2,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=2
Found a winner
Q value=0.757337 Action=3
Final winner for state 2 =3
First state=3,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=3
Found a winner
Q value=0.757337 Action=4
Final winner for state 3 =4
First state=4,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=4
Found a winner
Q value=0.757337 Action=5
Final winner for state 4 =5

First state=3,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=3
Found a winner
Q value=0.757337 Action=4
Final winner for state 3 =4
First state=4,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=4
Found a winner
Q value=0.757337 Action=5
Final winner for state 4 =5

First state=5,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=5
Final winner for state 5 =5

First state=2,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=2
Found a winner
Q value=0.757337 Action=3
Final winner for state 2 =3
First state=3,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=3
Found a winner
Q value=0.757337 Action=4
Final winner for state 3 =4
First state=4,
Found a winner
Q value=0.539621 Action=0
Found a winner
Q value=0.542437 Action=4
Found a winner
Q value=0.757337 Action=5
Final winner for state 4 =5

First state=4,
Found a winner

You can see the different Q-values for each action produced by the output of the Neural Network. (Needs more work though to get it to converge)

It makes mistakes and doesnt converge yet but with more work it might!

If anyone wants the code for this one (Based on the Mnemstudio C++ original) please add a comment.










Tuesday 3 April 2018

ECG on Orange Pi Zero

This project utilizes the MCP3208 A2D convertor to serve analogue data collected from an Instrumental Amplifier circuit that reads my heart beat.

The MCP3208 uses Spi-dev as detailed here which installs on Armbian. You can also install ASCII-Graph via PIP and produce a barchart of your heart beat.
Edit spiread.py as follows:

if __name__ == '__main__':
        spi = MCP3208(0)

        count = 0
        a0 = 0
        a1 = 0
        a2 = 0
        a3 = 0
        graph = Pyasciigraph()
        while True:
                count += 1
                a0 += spi.read(4)
                a1 += spi.read(5)
                a2 += spi.read(6)
                a3 += spi.read(7)
                data = [('Output',a3/300)]
                for line in graph.graph('Output', data):
                        print(line)

The circuit is taken from here and uses the first stage filter to produce a rudimentary ECG.

The electrodes are here . The signal vary's from 400 to 0 and the gain of the amplifier can be changed using a variable resistor over pin 1,5 of the Instrumental Amplifier. The first stage filter is necessessary to exclude noise from power source.

If you hold both the inputs you will see the voltage difference drop to zero. If you connect the electrodes and place them on your chest (Left side) the signal will vary with your heart rate.