Color fitting neural network

First of all, you should use the term “strong AI” instead of “real AI”. The latter term doesn’t mean anything.

As far as I can tell, 1waffle1 thinks you’re talking about applied AI. And in that respect neural networking has been extremely successful. Have you not heard about AlphaGo lately?

Yeah, AlphaGo is pretty impressive. Chess bots can use a combination of brute force and heuristics to tell which directions are worth branching into, but AlphaGo is completely different from that. Go is too big to brute force, there are too many moves. It beats the best players in the world. I figure a neural network can out-perform humans at any goal-oriented task.

1 Like

Ye, I meant strong AI.
But I’m not impressed with an AI learning a fixed set of rules. Beating a worldchampion in chess was done already in 1996, now they just do it with a more complex game.

What I would call actual learning is: take a bounce of inputs and plug it into the system. Give it a hurt sensor to know when it’s doing wrong. Give it some outputs to control. Then it should develop itself from scratch. Creating it’s own layers of understanding.
A one wheel robot should learn to stand simply by hurt detector activating when it hits the ground. When somebody does that, then I’ll be impressed.

Atm, all we are doing is writing unnecessary complex codes that confuse people into thinking it’s intelligent.

Atm, all we are doing is writing unnecessary complex codes that confuse people into thinking it’s intelligent.

Nobody here is trying to fake strong AI… neural networks are incredibly useful and are worth learning about. They’re used extensively in the business world for data mining.

Backpropagation is a supervised learning technique. What you just described is called unsupervised learning, and there are plenty of techniques invented to do so.

There’s nothing different in principle from your robot and, say, the software that Ayasdi has written. And the latter is far more useful, not to mention impressive.

So what you’re looking for is a network that changes its own structure, rather than a set of weights? I’m not sure anybody’s actually designed something like that.

Eh, I missed the part about self-modification. I’ll concede that that’s not a common practice in machine learning AFAIK. But it’s not like the human brain modifies itself directly. All of that comes from DNA and hormones.

Approximating a parabola with backpropagation:

I made a similar display to yours, also :stuck_out_tongue:

Actually I did the backpropagation incorrectly. After fixing it, it works much better.

What are you using for the E and dE parameters in the parabola network? also what did you change in the backpropagation?

I’m using a sum of squares error function E(t, x) = 1/2 * (x-t)^2. dE is just the derivative w.r.t. x, in this case x-t.

My problem with the backpropagation was that it would fit one data point at a time, instead of adjusting for every point each iteration.

that’s the learn function? what did you do to fix that? this is my test of your module

it tries to fit to the parabola, but it looks more like a cubic curve. why is there even a curve at all, though? shouldn’t this just be input → output with a weight and a bias? the whole network should just be producing a function of the form y=mx+b, right? why is it making curves? create({1,1}, …) means 1 input, 1 output, nothing in between, right?

edit: I see why it’s curved now, it’s following the logistic function K and not just direct coefficients of the input.

This is the problem approached in Reinforcement learning - Wikipedia and potentially in General game playing - Wikipedia .

More modern ML systems tend to be a jumble of lots of existing ML ideas combined in some way. The difficulty is in avoiding overfitting (and underfitting). Boosting (machine learning) - Wikipedia is an example where many simple classifiers are used to generate an output, but you could use more complex classifiers or even layers of boosting if you wanted. The issue again being overfitting.

Are you using neural networks to solve a regression problem? It looks like your original model only has a sigmoid function, so you should probably use the neural network to generate coefficients for a polynomial model. I’ve only used neural networks for classification, so I don’t know what modifications are needed to get it working for regression.

(also, least-squares would be a better algorithm for fitting polynomials as it finishes in one update pass with ideal results.)

1 Like

I just changed the control structure. The original one was set up to finishing optimizing for a single point, then the next point, etc. This had the effect of making the curve intersect only the one point, then reshaping the curve altogether in the next iteration. So I made it so that instead it’d increment the weights once for each point, per iteration.

It’s exactly the algorithm mentioned on the WP article.

Nah, I’m just fooling around with it. I read about the universal approximation theorem on Wikipedia and wanted to test it out myself.

i seem to have done this wrong in editing your module

local function learn(inputset,targetset,alpha)
	local change={}
	for i=1,#inputset do
		doInput(inputset[i])
		d(targetset[i])
		for n0,myWeights in pairs(weights)do
			for n1,w in pairs(myWeights)do
				change[n1]=(change[n1]or w)-alpha*delta[n1]*values[n0]
			end
		end
	end
	for n0,myWeights in pairs(weights)do
		for n1,w in pairs(myWeights)do
			myWeights[n1]=change[n1]
		end
	end
end

main script: local create=require(script.Parent.ModuleScript)local folder=workspace:FindFir - Pastebin.com

it’s just making a line and rotating/shifting it. I changed the learn function to add up the changes to each weight before actually making the change. I also made it only run once at a time rather than repeat until within error.

edit: not doing that was an improvement:

local function learn(inputset,targetset,alpha)
	for i=1,#inputset do
		doInput(inputset[i])
		d(targetset[i])
		for n0,myWeights in pairs(weights)do
			for n1,w in pairs(myWeights)do
				myWeights[n1]=w-alpha*delta[n1]*values[n0]
			end
		end
	end
end

i see that adding up all of the changes in weights makes it try to shift it in every direction at the same time and just cancel out into a line.

it seems to have trouble learning when there’s more than one hidden layer.

I made a neat network display

Boxes represent nodes. x axis is the input, y axis is the output (in red). there is a green line for each weight connecting to the next layer, where it is shown as sigmoid(red*weight). biases are not displayed. last graph has a blue curve which is the target function. vertical purple segment is placed at the largest difference between the target and the output.

It takes quite a long time just to get this accurate. Is there a nice way to make it get here faster? learning rate (alpha) is 1.

1 Like

Well, supposedly the next step is to add a momentum term into the weight change formula.

momentum seems to make it less and less stable as the momentum coefficient approaches 1 rather than speeding up the learning rate. it generally brings the network to a state where some nodes are dead and it can’t learn anymore. backpropagation doesn’t change the dead nodes because they don’t have any effect on the network, so they cause no error that would be corrected by altering them.

those nodes are killed by backpropagation because it is beneficial to the network to reduce the effect those nodes have. once other parts of the network are sorted out and those nodes become useful again, they won’t be changed because they were killed off.

By ‘dead’ do you mean that the weights vanish? It certainly doesn’t seem to be happening that way for me. I’ll post my code once I get home. Also, you have to taper off the learning rate if the momentum is close to 1, otherwise the system will oscillate about the minimum.

With the learning rate set to 1 and the momentum set to 1, in my display, the weights all drop to the bottom and the green lines representing output go to the middle. When I change the momentum back to 0 after it’s like that, it doesn’t change the network any more and the output is just a line.

That’s really strange. Are you sure you implemented it correctly? It should be increasing the weight changes by quite a lot. When I let it run long enough, some of the weights reach 10 or 20.