« first day (467 days earlier)      last day (1934 days later) » 

1:05 AM
60000 0.185 0.000 0.185 0.000 neural_net.py:67(run)
60000 calls only take 0.185 seconds, let's see see what pybrain needs for that...
60000 0.953 0.000 5.338 0.000 module.py:119(activate)
So, PyBrain in Python takes 0.953, FANN which is a C extension to Python takes 0.185. Nice speedup. :D
That's about 5 times as fast, so it won't have much impact on the frame rate anymore.
Another difference is the total run time.
FANN: 360046 function calls in 0.842 CPU seconds
PyBrain: 4260317 function calls (4080317 primitive calls) in 9.372 CPU seconds
So much function calls... :S
And the speed up there is like 11 times faster.
So, @IvoFlipse, if you planned on using PyBrain you might want to ditch it when you really need to compute a lot of neural network data.
 
2:07 AM
Seems there is actually a fault in Python 2.6.X which was fixed somewhere in Python 2.7.X, argh...
I hope all libraries work there, but no time for upgrading now.
(It involves bad cleanup in the garbage collector which results in bad cleanup after making some call where I pass an array to the C extension, by swapping around two lines they fix that :P)
Or at least I hope so. Alternatively, I could just ignore getting the numbers FROM the NN and only put values into the NN; hence, manually initializing the NN at the beginning.
If and only if the set procedure does work. :P
But given that's an array of numbers instead of an array of structs it should...
 
2:25 AM
Eh well, I can set them one by one. I have to evolve them once every so many activations anyway.
F:\Personal\Documents\Programming\Eclipse\Experimentation>test2.py
Layer / Neuron 0123456789012345
L   1 / N    4 aaAA............
L   1 / N    5 aAAa............
L   1 / N    6 AaaA............
L   1 / N    7 aaAa............
L   1 / N    8 ................
L   2 / N    9 ....AAaAA.......
L   2 / N   10 ....AAAaa.......
L   2 / N   11 ....aAaaA.......
L   2 / N   12 ....aAAAa.......
L   2 / N   13 ....AaAAA.......
L   2 / N   14 ....aAaaa.......
L   2 / N   15 ................
L   3 / N   16 .........aAaAAAA
Setting them all to 1.0 seems to work quite fine, results into [0.0, 0.0] as a result which is expected.
Seems the first one is always square, to remap the input.
The second one is it's own length X previous length +1, same for the last one.
Woops, I accindentally had two hidden layers. So even my benchmarking is quite off in the positive way. :D
Layer / Neuron 012345678901
L   1 / N    5 AAAaa.......
L   1 / N    6 aaaaA.......
L   1 / N    7 aAAaa.......
L   1 / N    8 aaaaA.......
L   1 / N    9 AAaaa.......
L   1 / N   10 AAaAa.......
L   1 / N   11 ............
L   2 / N   12 .....aaaaAaa
L   2 / N   13 .....AaaAaaA
L   2 / N   14 ............
[1770920.0, -1.2970939874649048]
[0.0, 0.0]
Layer / Neuron 012345678901
L   1 / N    5 AAAAA.......
L   1 / N    6 AAAAA.......
L   1 / N    7 AAAAA.......
L   1 / N    8 AAAAA.......
L   1 / N    9 AAAAA.......
Much better.
@IvoFlipse: Am I supposed to evolve the bias value just like the other values, or should it have a constant value?
Column 4 and 11 are the bias columns, in the original they seem to have random values as their strength (the a-Ab-B...z-Z value) aren't equal.
Erm, I'll just try to evolve them.
But writing the algorithm to write them away is for next time, glad I already got rid of this performance issue. ^^
And as I have to start working towards exams next time probably isn't soon...
Given that it's only one hidden layer now instead of the accidental two I guess I have optimized it by another 0.25% improvement.
@studiohack: Feel free to migrate the above to Fake Programmers, till this line. ^^
Time to go catch some sleep.
 
 
2 hours later…
4:12 AM
32 messages moved from Root Access
 
 
6 hours later…
9:55 AM
@TomWijsman You should initialize them to random values
@TomWijsman Premature optimization if you don't even know if its working :P
You should download the programming assignment from ML-class about neural networks
you could try to redo it in Python rather than Octave
 
 
2 hours later…
12:14 PM
@IvoFlipse I know, that was just to test whether I could assign something to them.
@IvoFlipse I do know that it is working, I have a program that runs at 13 - 20 FPS that should be capable of running at higher speeds.
Now it should be able to run at higher values like 100 FPS (or at least 60 FPS to see what's going on).
Python was just way too slow for running 100 NNs on every tick (13 - 20 ticks a second)...
In other words, I'm replacing the slow PyBrain implementation (for which a faster solution is Linux only) by this faster FANN implementation which is a solid C library.
Its way to access it in Python is not fully supported, but its working now.
But well, exams first now and I'll try to plug the new calls in after the exams. :)
@IvoFlipse: Another optimization I did is writing a point cloud which sections the points my machines need to gather into sections on the screen, and then it only checks the closest sections against the machine instead of the full screen. Only if those sections contain nothing it does a check on the full screen, which I could still optimize by gradually taking the next closest sections.
Because that also had heavy effect on the performance.
 
 
8 hours later…
8:32 PM
argh @DMA57361 this one exercise is driving me nuts
 
@IvoFlipse oh dear :/ which course?
 
from Stroustrup's book: Programming: Principles and Practice using C++
Chapter 6 consists of writing a calculator
but we have to add a factorial clause
which binds stronger than / or *
and we made a 'grammar' to check the syntax
so if it encounters a (, it will collect other bits until it hits ) and then evaluate the expression in between
 
right, makes sense
 
stuff like that
 
more an expression parser than a calculator?
 
8:37 PM
but factorial is nasty in that the operator comes after the number, which we dump in some stream, but I simply don't understand how to retrieve the preceding number :\
Here's a version he bugged on purpose, which lacks it
and yes, its more an expression parser in that sense
 
well, I've not looked at the code yet, but how does a + find the number before it (so it can add the one after it to it)?
 
we have 3 levels, primary (floating point literals & parentheses), terms (* and /) and expressions (+ or -)
what expressions does is call terms, to collect its lefthand side
double expression()		// deal with + and -, calls term() and ts.get()
{
	double left = term();		// read and evaluate an Expression
	Token t = ts.get(); 		// get the next Token from the Token stream
	while (true){
		switch (t.kind){			// see which kind of token that is
		case '+':
			cout << left << " + " << term() << endl;
			left += term();			// read and evaluate an Expression
			t = ts.get();

			break;					// then do an add
		case '-':
			left -= term();			// read and evaluate an expression
			t = ts.get();
double left = term()
if term doesn't contain * or /, it uses term's default case
which is the same as the default case of expression
it returns 'left' which for term is "primary()"
and it get's a Token t from ts (token_stream) , which it puts back because it wasn't used
guess I should check what both of those values are
but given for term, left = primary(), the value is whatever primary returns
which is an expression() if there are ()'s so I can ignore that for now
and if its a number, it returns the value
but because factorial is supposed to bind stronger than * or / in term, I've added a case to primary
but now I have no idea how to get to the value :\
 
ah, well doesn't primary usually feed the numbers down to term and expression?
can you insert a factoral() between term and primary?
 
it does
you mean, add another function that sits between those layers?
 
yes
 
8:46 PM
that might make sense
 
at the moment they call in the order expression→term→primary
you need the result of primary to do the factorial calculation but you need to be above term for the correct binding
 
Hmmm this seems to work better I believe
now I just need to return it the right way
Its almost working, but I calculate 7! as 720 (which is 6!)
so my loop is probably ending prematurely or something
 
yey! another pointless steam xmas achievement :P
 
hehe in Sanctum? :P
 
indeed
anyway; so it's reading it in the expression correctly?
 
8:56 PM
darn, that solution is just ridiculously easy...
Yup working perfectly
 
good :)
 
Simply added a layer like you said
Don't really get why I couldn't add that layer to primary itself though :\
 
because then it can't get the value from itself?
 
if you'd call it recursively it could
but I guess that would be a nightmare
 
it could get messy, I'd imagine, yes :/
 
8:58 PM
well at least now I can continue with the exercises :P
 
lol, you sound thrilled ;)
 
Glad I finished this one ;P
it even works for 7! * 2, nice
 
now get it to work with ² and ³ ;P
 
with or without ( ) ;P
well I guess the program wouldn't care
and it would be similar to factorial
meanwhile @SimonSheehan is thinking we've lost it
 
indeed, so instead do whatever's next in the book; probably more useful
 
9:01 PM
Or you know: listening to Bastion's soundtrack
Define a class Name_va lue that holds a smng and a value. Give it a constructor
(a bit like To ke n). Rework exercise 19 in Chapter 4 to use a
vector<Name_value> instead of two vecto rs.
 
@IvoFlipse have you played the game yet?
 
nope
was hoping to do some gaming tonight, but was planning to do it after I finish the exercises
I'll regret that I guess
 
lol, oh well, the soundtrack is pretty good but possibly lacks context if you've not played yet
 
It sounds like Cowboys & Aliens
 
@IvoFlipse Not quite, getting close ;)
 
9:03 PM
nice I've been only 28% distracted today, on 10.5 hrs
according to RescueTime
 
Haha. Mine would easily tip 90%
 
O_o ack, not sure I'd want to know that figure
 
I'm avoiding all work until next week :P
 
meh, was back at work today ):
 
Its exactly why I want to know @DMA57361 ;)
 
9:04 PM
2 week holiday for me, wooo
 
I want to be more productive
 
Oh clippy, always here to rescue us
Oh crap, just realized I've gotta get my license in 9 days.
Totally forgot
 
That's easy isn't it?
Write a program where you first enter a set of name·and·value pairs,
such as Joe 17 and Barbara 22. For each pair, add the name to a veclor
called names and the numbcr to a vector called scores (in corresponding
positions, so that if names[7]=="Joe" then scores[7]==18). l cnninate
input by the line No more ("more" will make the attempt to read anotller
integer fail ). Check that each name is unique and terminate with an crror
message if a name is entered twice. Write au[ all the (namc,score) pairs,
hoeray for writing trivial programs
 
gah, stupid browser crashed
 
what were you doing?
 
9:11 PM
trying to reply to you :P
 
Right, now i need to remind myself to figure out how to parallel park again
 
@SimonSheehan oh, driving test?
 
@DMA57361 Yep, for the 2nd level of a license.
 
2nd level?
 
We have 3 levels of licenses. G1 = Learners permit. G2 = Basically a full license with a few restrictions. It basically says you can't be a designated driver for your under age drunk teenage friends.
G = full license.
 
9:14 PM
ah ok
 
Of course, people totally ignore those restrictions and do still drive their drunk friends home
 
indeed
 
But, guess i am at that age..
 
Can't wait for Google's self-driving cars
 
Haha, that's gonna be really cool... although apparently one of them crashed recently.
 
9:17 PM
Write a program that checks if a sentence is correct according to !.he
"English" grammar in §6.4. 1. Assume that every sentence is tenninated
by a rull SLOp (.) surrounded by whitespace. For example, birds fly but
the fish swim . is a sentence, but birds fly but the fi sh swim (tenninating
dot missing) and birds fly bur the fi sh swim. (no space before dOL) are
not. For each sentence entered, the program should simply respond
"OK" or '"'not OK." Hint : Don't bother with tokens; just read into a
Holy crap, that's a lot of work...
 
O_o
 
And where on earth would I have to add "the" so I can say "bird fly but the fish swim"
I'm not familiar with the English terminology
 
shrug, I think it should be "birds fly..." too, so who knows
 
I guess the want me to add a new category, which can go with the nouns
Interesting problem though
but they say I shouldn't use Tokens, but I wonder if we shouldn't be using the stream either (like putting back items :\ )
Would be much easier to loop recursively and check for the i-th element, whether the ith+1 is of the correct type
well doesn't even have be recursively, that can be done in one statement really
 

« first day (467 days earlier)      last day (1934 days later) »