<dark>
hmmm... it is returning what i thought it was going to return, o.o
<sc30317>
where I would want it to be [0.;2.;3]
zhijie1 has joined #ocaml
<dark>
what it should return, in this case?..
<dark>
ahn, o.o
<sc30317>
oh
zhijie1 has quit [Read error: Connection reset by peer]
<sc30317>
I could change that -1 to a?
<dark>
then change the signal_of_floats parts
<dark>
yes.. o.o
<dark>
do you know how to turn this into a tail-recursive version? (do you know the difference?)
<sc30317>
no (to both accounts)
<dark>
the method i know is to build a function that will hold an accumulator
<dark>
hmm did you ever heard people saying 'don't do this recursive, because you can fill up the stack'?
<sc30317>
yes
<sc30317>
I have done that before :D
<dark>
as you already noticed, this algorithm has an imperative version.. with for, that will not use a stack
<dark>
ocaml will turn the recursion to a loop automatically, whenever it encounter this pattern.. but only for certain kind of functions
<sc30317>
ok
<sc30317>
so there is no reason to use the imperitive version?
<dark>
in fact, whenever the return value of a function is a tail call (i.e., just a call to another function), it does not need to do a call + return.. it can do just a jump
zhijie1 has joined #ocaml
<dark>
in ocaml, no, the code generated is the same -- but only if you write your recursive functions using only tail calls
<dark>
i.e., your functions must be tail-recursive
<sc30317>
ok
<sc30317>
why do you say tail-recursive?
<sc30317>
is there another "head" recursion?
<dark>
hmm i'll write a tail-recursive factorial for you
zhijie1 has quit [Read error: Connection reset by peer]
<dark>
let fat n = let rec fat_loop acc c = if c = 0 then acc else fat_loop (acc * c) (c - 1) in fat_loop 1 n
<dark>
do you know the "normal" version, right? let fat n = if n = 0 then 1 else n*(fat (n-1))
<dark>
let rec fat
<sc30317>
yes
<sc30317>
I was actually looking at that earlier
<sc30317>
let rec fact x = if x=0 then 1
<sc30317>
else x*fact(x-1);;
<dark>
notice that in the recursion case, the result of fat_loop is directly the result of a call of fat_loop itself
<dark>
in the usual factorial, you need to store the intermediate values of fact x
<dark>
because you need to * them after calculating all values
<dark>
in the tail recursive version, you don't o.o
<sc30317>
ooooooh
<sc30317>
gotcha
<sc30317>
I understand now
<dark>
if you don't know exactly that you need tail recursive functions, you usually don't
zhijie has quit [Read error: Connection reset by peer]
<sc30317>
that is way cool!
<dark>
it looks like you learned it fast (i didn't...), but just to clarify, in the fact example, the tail recursive factorial will be translated into a loop, that will update two variables: an accumulator, and an index. it will be just like for (int i = n; i >0; i--) acc *= i;
<dark>
yes it is :)
<sc30317>
cool man
<sc30317>
I have a couple more questions if you dont mind
<dark>
i don't mind ^^
<sc30317>
ok, how do I get ocaml to not think this is a comment?
<dark>
'this' being..?
<sc30317>
let vector_mult input1 input2 = List.map2 (*.) input1 input2
<dark>
( *. )
<sc30317>
oh
<sc30317>
space?
<dark>
(* .. *) is a comment, ( * .. * ) isn't
<sc30317>
gotcha
<sc30317>
ok
<sc30317>
I want to do a weird mult
zhijie has joined #ocaml
<sc30317>
h/o let me do a pastebin of it
<dark>
hm
<dark>
ps: you can implement that map2 using the same technique i used to do my_compare
<sc30317>
yea, now that you showed me that I realize the my_compare could work a myriad of different ways
<dark>
all of this is just a single operation: fold [fold can be used to build map, and this my_compare]. most functional code will be written using folds, maps, etc instead of bare recursions
<sc30317>
thats the thing; im not allowed to use the array modules
<dark>
it's a assignment?
<dark>
an
<sc30317>
no
<sc30317>
boss said so
<dark>
boss..? wtf, he actually understand anything at all about ocaml?
<sc30317>
not really; I think he just wants me to learn the constructs of the list module?
<dark>
is this 'real world' job, or in academia?
<sc30317>
real world
<sc30317>
:D
zhijie has joined #ocaml
<dark>
omg
<sc30317>
yea tell me about it
zhijie has quit [Read error: Connection reset by peer]
<sc30317>
systems programming in ocaml
<sc30317>
wtf
<dark>
but where?
<dark>
i have saw some of this
<sc30317>
where what?
<dark>
but never saw matrix multiplication with lists
<dark>
where are you?
<sc30317>
south carolina
zhijie has joined #ocaml
<sc30317>
very small company
zhijie has quit [Read error: Connection reset by peer]
<dark>
interesting o.o
<dark>
but okay: you need to be somewhat clever if you want to avoid writing recursions by hand and still have a correct program (ps: forget the List.nth .. lists are not arrays)
<dark>
if you are learning ocaml, i suggest you to simply accept that all your list functions will be written in a recursive style
<dark>
no matter what they do
zhijie has joined #ocaml
<sc30317>
ok
zhijie has quit [Read error: Connection reset by peer]
<dark>
now you need to think if you want to recourse on the first list, on the second, or both, but i suggest recour..sing?(this word doesn't seems to exist) on the first
<sc30317>
ok
<dark>
but the result of each row will be something like multiply a list
<dark>
right?
<dark>
a is a number, list er a list
<dark>
then multiply needs to be another recursive function
<dark>
:P...
<sc30317>
a is a number
<sc30317>
a float
<dark>
but you can write this easily with fold
<dark>
List_fold_left (+.) 0.0 list
<dark>
will sum all elements of a list
<dark>
0.0 is the base case (for the empty list)
<sc30317>
ok
<dark>
+. is really (fun a b -> a +. b)
<sc30317>
ok
<dark>
i.e you can use fold for building an arbitrary data structure from iterating the elements of a list
<sc30317>
sounds good
ulfdoz has joined #ocaml
<dark>
the function that is the first parameter of a fold receives two parameters a and b: a is the accumulator, b is the top of the list
<dark>
and returns a new accumulator (that may be returned when the list is over, or will be passed as the acc of the next function call)
<dark>
you can implement this function if you are not confident it works and is tail recursive
<sc30317>
ok
<dark>
in fact you can use fold for building the entire function too
<sc30317>
cool!
<dark>
you want to build a "data structure" from a "list"
<sc30317>
alright....
<dark>
(ps: there is usually fold for every iterable data structure in ocaml, like sets)
<sc30317>
dark, where are you located?
<dark>
i'm at natal, brazil
<sc30317>
oh cool!
<sc30317>
talk about far away!
<dark>
hehe :)
<dark>
there is a professor here that is from france, he teaches ocaml for freshmen here
<sc30317>
cool
<sc30317>
are you a uni student?
<dark>
people hate this, but i enjoy ocaml (and functional programming in general)
<dark>
yes ^^
<sc30317>
thats cool
<dark>
i found surprising a small company is working with ocaml, and apparently misusing it (or maybe not?)
<dark>
there are some (quite small...) companies here, but they will work with java...
<dark>
or c++, or microsoft languages
<mrvn>
dark: His boss is just verry bad at teaching ocaml.
<sc30317>
hey mrvn
<sc30317>
whats up?
<mrvn>
breakfast
<sc30317>
hah
<sc30317>
where are you?
<mrvn>
germany
<sc30317>
cool
<dark>
sc30317, you need to first program a "dot product"
<dark>
no err i meant by modifying the other function, my_something
<sc30317>
oh ok
<dark>
maybe let rec dotproduct a b = match a, b with [], [] -> 0. | _::_, [] | [], _::_ -> failwith "diff size" | a::r, b::s -> (a * b) + (dotproduct r s)
<dark>
not tail recursive
<mrvn>
let dotproduct v1 v2 = List.fold_left (fun x (a,b) -> x +. a *. b) 0.0 (List.combine v1 v2);;
<dark>
sc30317, actually.. is the leght of the lists fixed..?
<sc30317>
yes
<sc30317>
absolutely
<dark>
sc30317, can you tell what your company does?
<sc30317>
yea
<sc30317>
System Automation
<sc30317>
we produce bottling lines
<sc30317>
(for like your coca cola, gatorade, etc.)
tmaedaZ is now known as tmaeda
<dark>
this wouldn't usually be done with C? (i study computer engineering, i might go to this area, 'automation')
<mrvn>
let dotproduct = List.fold_left2 (fun x a b -> x +. a *. b) 0.0;;
<mrvn>
let transpose m = List.map List.rev (List.fold_left (List.map2 (fun xs x -> x::xs)) (List.map (fun x -> [x]) (List.hd m)) (List.tl m));;
<dark>
maybe your boss just love FP
<mrvn>
let mul m1 m2 = List.map (fun v1 -> List.map (fun v2 -> dotproduct v1 v2) (transpose m2)) m1;;
<sc30317>
haha thats what I studied in school too
<sc30317>
yea I think my boss is just silly
<dark>
mrvn, =o awesome
<mrvn>
dark: At least you wouldn't usualy do this with lists
<dark>
yes, that's what i was thinking mrvn
<mrvn>
transposing a list list is a pain
<dark>
ocaml is just fine for this job, but with arrays (maybe with a high memory footprint, but if you aren't in an embedded env this is fine...)
<dark>
i was writing this: let rotate matrix vector = match matrix, vector with [[r1; s1; t1]; [r2; s2; t2]; [r3; s3; t3]; [r4; s4; ...
<mrvn>
dark: records containing just floats and float arrays are optimized in memory
<dark>
... | _, _ -> failwith "..."
<dark>
mrvn, yes, i know.. but there are the entire ocaml runtime too. plus, ocaml will not work on many (most? all?) microcontrollers
<dark>
(even C will not do the job sometimes..)
<mrvn>
The transpose still sucks. Should ahve used fold_right
<dark>
are you thinking about performance?
<dark>
i guess this is not a problem for sc30317's boss :)
<sc30317>
pssh
<sc30317>
probably not
<sc30317>
mrvn, im sorry, I needed a matrix and a vector
<sc30317>
like in my pastebin
<dark>
sc30317, the problem is: if you use mrvn's code, you will _surely_ impress your boss. but this may backfire: he will a) give more job to you, that will be hard to handle, b) he will find out quickly that you haven't learned that much still (but the tip is: if you want to survive programming in ocaml, learn how to use that folds and maps effectively)
<dark>
you can do mul m1 [m2]
<dark>
hm no
<dark>
yes :)
<sc30317>
yes what?
<dark>
mul matrix [vector]
<mrvn>
dark: if the dminesions are right
<dark>
if the dimensions are wrong, the code should just give an error i guess...
<mrvn>
Exception: Invalid_argument "List.map2".
<dark>
probably good enough.. one can encapsulate the code and raise a more user-friendly exception i guess..
<sc30317>
yea
<dark>
sc30317, when you get that code with many ( .. ), you can break it in many lines, and write begin .. end
<sc30317>
ok
<mrvn>
One can declare module Vec : sig type t = private float list val make : float -> float -> float -> t end = struct type t = float list let make x y z = [x; y; z] end
<mrvn>
Thereby ensuring any Vec.t IS a 3 float list.
<dark>
i think your boss is fairly good with FP. you should take a look in his code (if he provides some code for you..) in order to learn about his style.
<dark>
hmm
<dark>
:)
<dark>
private?
<mrvn>
dark: prevents anyone outside the module from creating a Vec.t while allowing using a Vec.t as float list.
<sc30317>
ok
<dark>
mrvn, very nice.. new feature? or ever existed?
<sc30317>
mrvn, that mul doesn't seem to want to work when using it with a matrix and a vector?
<dark>
sc30317, let mul_with_matrix_and_vector matrix vector = mul matrix [vector]
<mrvn>
sc30317: obviously. A vector is a different type.
zhijie has quit [Read error: Connection reset by peer]
<sc30317>
obviously
<mrvn>
dark: wastefull
<dark>
hmm?
<dark>
why?
<mrvn>
dark: because you apply List.map on a one element list
<sc30317>
mrvn, how could I fix it to do a matrix dot vector
zhijie has joined #ocaml
<dark>
the reason i think he is fairly good with fp is that a) if you try to program with C style, ocaml is a annoying, b) most people that love ocaml, love actually FP, c) it's said that ocaml is very fun to program... but only if you like FP. so in fact i think you can learn much reading his code sc30317
<flux>
it's quite a save if developer time is a resource ;)
<mrvn>
sc30317: you learn ocaml and you lookup the mathematical definition of matrix * vector
<sc30317>
ok
<sc30317>
thanks!
<sc30317>
haha
<mrvn>
dark: Unlike other functional languages ocaml has "fun".
<dark>
mrvn, well, he said that the dimensions of the vector and matrix will *never* change, so in fact the general solution is overkill
<dark>
yes :)
<sc30317>
dark, are any of the functions you gave me good for matrix dot vector?
<dark>
i really don't know how to multiply a matrix with a vector o.o
<mrvn>
sc30317: the task is to write your own so you learn something.
<sc30317>
im trying mrvn, its just 3:04AM here
<sc30317>
and im really tired
<sc30317>
and I am really close to finishing this project
<dark>
i know how to multiply a AxB matrix and a Bx1 matrix
<mrvn>
dark: then you only need to covert a B vector to a Bx1 matrix
<mrvn>
convert even
<dark>
hmm i think [vector] isn't a Bx1 matrix, it's 1xB.. then, omg
<dark>
in order to use your code unchanged, maybe he needs to apply a transpose
<mrvn>
dark: My mul might be transposing the wrong matrix.
<dark>
and your code will apply a transpose again..
<dark>
then it would be mul matrix (transpose [vector]) sc30317, but i don't have an interpreter here
<sc30317>
ok ill try it
<dark>
sc30317, an honest thing to say is that you couldn't finish because you don't know ocaml
<sc30317>
nope
<sc30317>
dark, I think your right
<mrvn>
sc30317: AxB mat * B vec means building the dotproduct between every row of the matrix and the vector.
<mrvn>
Just do it directly.
<sc30317>
do what directly?
<mrvn>
the dotproduct between every row of the matrix and the vector
<flux>
btw, how should it differ from String.escaped anyway?
yakischloba has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
lokydor has joined #ocaml
<drewbert>
Hey guys I'm a beginner in OCaml. I've been looking through the tutorials trying to figure out what I'm doing wrong, but I can't figure it out. The parser just says ERROR: Syntax error. Can someone here take a look http://pastebin.ca/1846765
<flux>
you are missing 'then' before 'c'
<drewbert>
haha thank you so much
ikaros has quit [Quit: Leave the magic to Houdini]
<mrvn>
drewbert: try not using ()
pimmhogeling has quit [Ping timeout: 265 seconds]
<drewbert>
mrvn: the problem was with the "then" and adding that fixed it. I understand currying to some degree and that i'm not using it and that tuples as function arguments are not functional, but this is a school project that was assigned before we learned about them, and thus the project uses tuples.
<drewbert>
tuples as function arguments are not preferable to currying*
ttamttam has joined #ocaml
slash_ has joined #ocaml
Alpounet has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
Anarchos has quit [Ping timeout: 240 seconds]
ttamttam has quit [Quit: Leaving.]
lokydor has quit [Ping timeout: 246 seconds]
enthymeme has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
SEcki has joined #ocaml
rwmjones has quit [Ping timeout: 245 seconds]
lokydor has joined #ocaml
<thelema>
flux: odd. On my system, String.quote ""; -> - : string = "\"\""
maattd has joined #ocaml
<flux>
actually
<flux>
that's not the problem. it appears not to be deterministic..
<flux>
if I start a new session, the first String.quote seems to work
<flux>
but issuing String.quote "abc";; twice gives that error
<flux>
however, BatPrintf.sprintf2 "%S" "" or "abc" works just fine many times :-o
<flux>
(let quote = BatPrintf.sprintf2 "%S")
<flux>
ahha!
<flux>
eta-expansion to the rescue
boscop_ has joined #ocaml
rwmjones has joined #ocaml
<flux>
that kind of quote-function reproduces the problem but let quote s = BatPrintf.sprintf2 "%S" s doesn't
boscop has quit [Disconnected by services]
boscop_ has left #ocaml []
boscop has joined #ocaml
<flux>
doing the eta contracted version let quote = BatPrintf.sprintf "%S" works fine as well
bzzbzz has joined #ocaml
ulfdoz has joined #ocaml
krankkatze has joined #ocaml
oc13 has quit [Ping timeout: 276 seconds]
thrasibule has joined #ocaml
hcarty has quit [Quit: leaving]
bluestorm has joined #ocaml
hcarty has joined #ocaml
<hcarty>
Testing...
<hcarty>
Sorry for the noise. I was getting "Cannot send to channel" errors from irssi. A restart seems to have fixed it.
<flux>
maybe it was the reconnect
<hcarty>
flux: That is my guess
oc13 has joined #ocaml
thrasibule has quit [Ping timeout: 260 seconds]
smimou has quit [Ping timeout: 246 seconds]
<hcarty>
Just completed my first real use of functors as a module writer rather than as a module consumer. Nifty stuff.
smimou has joined #ocaml
quelqun_dautre has quit [Ping timeout: 260 seconds]
quelqun_dautre has joined #ocaml
<bluestorm>
hcarty: I sometimes use functors to get incompatible abstract datatypes
pimmhogeling has joined #ocaml
<bluestorm>
module F (T : sig end) : sig type t ... end = struct t ... end
<bluestorm>
(recently I used that trick to represent "variables" in a programming language : I needed different type of variables, so I wanted different types to make erroneous mixing impossible)
<hcarty>
bluestorm: That's a good idea
<hcarty>
bluestorm: I used it in this case to reduce code duplication for c_layout and fortran_layout Bigarrays
<hcarty>
There are only two possible variations for this module. Is it better to expose the functor interface to the user, or apply the functor ahead of time to the two possibilities and hide the fact that this uses a function with the module's interface?
<hcarty>
s/function/functor/
drewbert has quit [Quit: Leaving.]
tmaeda is now known as tmaedaZ
<hcarty>
For example, provide Foo.Make, Foo.C_interface, Foo.Fortran_interface and/or provide Foo.C (= Foo.Make(Foo.C_interface)), Foo.Fortran (= Foo.Make(Foo.Fortran_interface))
<bluestorm>
hcarty:
albacker has quit [Quit: Leaving]
<bluestorm>
in an abstract setting, the functor would be better as it would allow the user to use your library unmodified if a other layout type was to be added to the stdlib
<bluestorm>
in practice, maybe plain modules are less confusing to the user, I don't know
<hcarty>
bluestorm: I may leave both. Hiding the underlying functor application is not turning out to be as simple as I had hoped
<bluestorm>
and they would allow you to manually inline them while remaining interface-compatible, if you found out it was beneficial for performance
<bluestorm>
hum
<bluestorm>
keeping the functor also allows users to extend the library by using functors themselve
<hcarty>
bluestorm: Thank you for the suggestions
schmx has joined #ocaml
schmx has quit [Changing host]
schmx has joined #ocaml
krankkatze has quit [Ping timeout: 256 seconds]
pimmhogeling has quit [Ping timeout: 256 seconds]
dark has quit [Ping timeout: 276 seconds]
pimmhogeling has joined #ocaml
rwmjones has quit [Ping timeout: 256 seconds]
drewbert has joined #ocaml
rwmjones has joined #ocaml
krankkatze has joined #ocaml
dark has joined #ocaml
dark has quit [Ping timeout: 258 seconds]
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
dark has joined #ocaml
krankkatze has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 245 seconds]
matthieu has joined #ocaml
maattd has quit [Ping timeout: 256 seconds]
oc13 has quit [Ping timeout: 248 seconds]
<sc30317>
hey all
<sc30317>
I have a (hopefully) very quick question
<drewbert>
how would one of you guys implement this simple function: (* grow_lists (x, y) -'a list * 'a list -> 'a list list - return a list of lists, where each element of x is prepended to y resulting lists must be in same order as in x - Example: grow_lists([1;2], [3;4]) => [[1;3;4]; [2;3;4]] *)
<sc30317>
its frustrating too; once I get this working, my whole program will work! :D
<drewbert>
I'm having a lot of trouble
<sc30317>
drewbert, look for the ::
<bluestorm>
drewbert: look for List.map
<sc30317>
that adds something to a list
<drewbert>
sc30317: I try to use :: but I keep getting type errors
<sc30317>
are you mixing ints and floats?
<drewbert>
no
<sc30317>
bluestorm, if I pastebin my whole code, do you think you could see why this is syntaxing?
<bluestorm>
drewbert: what you have to do is to return the list that, for each element of x, append to it the list y
<bluestorm>
this is what List.map does, applying a function to each element of a list
<bluestorm>
sc30317: yes
<drewbert>
thanks sc30317, bluestorm, I'll see where I can get using map
<sc30317>
yea, but that wont return w_init, correct?
<bluestorm>
no that won't
<bluestorm>
this is of type unit
<bluestorm>
because "if a then b" is equivalent to "if a then b else ()"
<bluestorm>
and () is unit
<drewbert>
let rec grow_lists(x, y) = map(fun h -> h::y, x) where map actually takes a tuple, but otherwise emulates map. I get "this expression should not be a function" error
<sc30317>
ok
<sc30317>
so then I need to add an else
<drewbert>
hah
<drewbert>
uhhh apparently i was missing parenthesis
<drewbert>
let grow_lists(x, y) = map((fun h -> h::y), x) works, but I have no idea why
<sc30317>
bluestorm, even doing what you just said gives me a syntax error
<bluestorm>
well
<drewbert>
sc30317: try adding parenthesis :-P
<sc30317>
drewbert, thats not what I need
<bluestorm>
fun h -> h::y, x is equivalent to fun h -> (h::y, x)
<bluestorm>
because , has higher precedence than function declaration
Associat0r has quit [Quit: Associat0r]
<drewbert>
bluestorm: thanks!
<drewbert>
I was banging my head against the keyboard for several hours on 1 line of code ><
<bluestorm>
that's an arbitrary syntaxic decision that is justified by the fact that you often have anonymous functions returning tuples, and rarely tuples of anonymous functions
<bluestorm>
drewbert: in doubt, use local declarations instead of anonymous functions
<bluestorm>
let grow_list(x, y) = let add_y x = x::y in map(add_y, x)
<bluestorm>
(do you know about curryfication ? map in OCaml usually doesn't take a tuple as argument)
<sc30317>
its saying
<sc30317>
let w_current = vector_add (vector_mult(error_vect lr_matrix)) w_current in
<sc30317>
This expression is not a function; it cannot be applied
<drewbert>
i know of curryfication, this project was assigned before they taught it though and map is actually a function they supllied that takes a tuple
Yoric has joined #ocaml
<drewbert>
for our "benefit"
<bluestorm>
sc30317: this is not a syntaxic error
<bluestorm>
this is a semantic error
<sc30317>
bluestorm, I fixed some stuff and then that is what I got
<bluestorm>
your "error_vect" is not a function, it's a non-functional value
<dark>
sc30317, let .. in .. is an expression, to evaluate expressions directly you should use let _ = expression in your program (otherwise you have to put ;;, or it is likely a syntax error..)
<bluestorm>
let error_vect = vector_mult lr_vector new_vect in ..
<dark>
let a = 2 let b = 3 is valid; let a = 2 let b = 3 in b+1 is not; but let a = 2 let _ = let b = 3 in b+1 is
<dark>
let a = 2;; let b = 3 in b+1 is also valid
<bluestorm>
dark: beginners usually find the "let _ =" form disturbing
<dark>
@.@ the program logic shouldn't need more than, say, one _
<dark>
then _ will be the "main" ;)
<sc30317>
bluestorm, that won't work either
<sc30317>
because
<dark>
but when i finally understood the _, i really liked it
<bluestorm>
dark: I rather use "let () = ..." because I find ignoring non-unit value is not a good practice
<bluestorm>
(and rather use an explicit "ignore" when I want that behaviour)
<dark>
bluestorm, hm @.@
<sc30317>
w_current needs to be (error_vect * lr_matrix) + w_current
<bluestorm>
sc30317: I just pasted your code. I was trying to point out that in the way you declared it, "error_vect" is not a function
<bluestorm>
oh
<bluestorm>
I just understood
<sc30317>
let error_vect = vector_mult lr_vector new_vect in
<sc30317>
if error_vect = [] then failwith "error_vect cant be empty"
<sc30317>
;
<sc30317>
?
<bluestorm>
vector_mult(error_vect lr_matrix)
<sc30317>
yes
<bluestorm>
you don't actually mean vector_mult(error_vect(lr_matrix))
<sc30317>
no
<bluestorm>
well that is what you wrote
<sc30317>
sorry
<sc30317>
let w_current = vector_add (vector_mult(error_vect lr_matrix)) w_current in
<bluestorm>
you want (vector_mult error_vect lr_matrix)
<sc30317>
ok changed
<dark>
ps: finish is a function? it does not receive a parameter. so you understand currying better now, right? o.o' (but if finish is a function, you can't compare it with true). also i think you don't need rec to do things like let a = b in a x