<sc30317>
I need to multiply anddata by the vector created in create_winit
<sc30317>
how would I do so?
smimou has quit [Read error: Operation timed out]
<mrvn>
Write a vector product or dot product function depending on what you mean
<mrvn>
or itemwise skalar product
<sc30317>
ok...
<sc30317>
but where does the stuff from create_winit get stored?
<sc30317>
so that I can use it for the dot product function?
<mrvn>
sc30317: in whatever you bind it to
<sc30317>
im confused
<mrvn>
you can just pass it as argument
<sc30317>
oh ok
<mrvn>
or bind it to a name and then pass that
<sc30317>
how could I bind it to a name?
<mrvn>
let name = ...
<sc30317>
but when I do this
<sc30317>
let x = create_winit(trainData);;
<sc30317>
it says that x is an unbounded value
<mrvn>
the () are not needed
<sc30317>
still gives same error
<mrvn>
doubtfull it says that about x
<sc30317>
File "sde3.caml", line 54, characters 21-30:
<sc30317>
Error: Unbound value trainData
<mrvn>
see, not x
<sc30317>
yea
<sc30317>
but it is coming from the line where I declare x
<mrvn>
but trainData isn't bound
<sc30317>
yea
<sc30317>
how would I bound it in that case?
<mrvn>
let traindata = ...
<sc30317>
but traindata is something I am passing in?
<mrvn>
you can only pass in what you have defined first
<sc30317>
that is true
<sc30317>
but I am passing in a List
<mrvn>
you are not. you are passing in an unbound value.
<sc30317>
ok, how do I pass in a bound value?
<mrvn>
same way you do now
dark has quit [Remote host closed the connection]
smimou has joined #ocaml
<sc30317>
mrvn, I have updated my code a bit. I feel like I am doing what you are saying but it doesn't seem to be working. Can you check it out? the recursive part of the fn is something I have been given
<thelema>
m:ms, v -> inner m v :: multiply_test ms v
<sc30317>
could you paste the whole line?
<sc30317>
its difficult to understand the fragmentst
<sc30317>
like this?
<sc30317>
let rec multiply_test = function [].[] -> 0.0 | m::ms, v -> inner m v :: multiply_test ms v | _ -> failwith "no"
<thelema>
that's closer.
<thelema>
your first match case should be [],_ -> []
<sc30317>
instead of [].[] -> 0.0
<thelema>
yes
<thelema>
the result of multiplying an empty matrix by any vector is an empty vector, no?
<sc30317>
yes
<sc30317>
this is true
<sc30317>
so this is what I have now
<sc30317>
let rec multiply_test = function [],_ -> [] | m::ms, v -> inner m v :: multiply_test ms v | _ -> failwith "no"
_zack has joined #ocaml
<thelema>
Your match says an empty matrix times an empty vector is 0.0
<sc30317>
not anymore :D
<thelema>
You don't need the last match - your first two cover all cases now.
<sc30317>
ok
<sc30317>
so now it is
<sc30317>
let rec multiply_test = function [],_ -> [] | m::ms, v -> inner m v :: multiply_test ms v
<thelema>
looks good to me.
<sc30317>
that comes up with
<sc30317>
Error: This function is applied to too many arguments;
<sc30317>
maybe you forgot a `;'
<thelema>
ah, the last bit should be:
<thelema>
multiply_test (ms,v)
<thelema>
similarly for inner - [inner (m,v)]
_unK has joined #ocaml
avsm1 has quit [Ping timeout: 264 seconds]
jcaose_ has quit [Remote host closed the connection]
<sc30317>
ok no errors now
drk-sd has quit [Quit: aw]
<sc30317>
but I am still not sure it works
<thelema>
test it.
<sc30317>
working on it :)
tmaedaZ has joined #ocaml
tmaedaZ is now known as tmaeda
<sc30317>
they have different length lists everytime
<sc30317>
because you are always multiplyling a matrix by a vector
<thelema>
how big is your matrix?
<thelema>
4x4?
<sc30317>
yea 4x4
<thelema>
how big is your vector?
<sc30317>
never mind
<sc30317>
it is a 3x4
<sc30317>
and you are multiplying it by a 1x3
<thelema>
each row of the matrix is 3 elements?
<sc30317>
sorry 3x1
<thelema>
the vector should be a row vector, even if it's being used as a column vector.
<sc30317>
yea
<thelema>
but the important thing is that the number of elements in each row (= list entry) of the matrix should be the same as the number of elements in the vector
<sc30317>
yea
<thelema>
the error you get indicates that isn't so.
<sc30317>
oh ok
<sc30317>
got it fixed! :)
<sc30317>
I figured out my problem, but that brought on another problem
<sc30317>
how would I take the last element of each List out?
<thelema>
given a list, you want that list without its last element?
<thelema>
you should be able to write a function to do this easily - it's not in any stdlib.
<sc30317>
oh ok
<sc30317>
I think I can write it
<sc30317>
I will try
<sc30317>
later, I need a break
avsm has joined #ocaml
ttamttam has quit [Quit: Leaving.]
oc13 has joined #ocaml
tmaeda has quit [Ping timeout: 245 seconds]
slash_ has quit [Quit: Lost terminal]
tmaeda has joined #ocaml
slash_ has joined #ocaml
slash_ has quit [Client Quit]
slash_ has joined #ocaml
_zack has quit [Quit: Leaving.]
Yoric has quit [Quit: Yoric]
slash_ has quit [Quit: Lost terminal]
slash_ has joined #ocaml
tmaeda is now known as tmaedaZ
enthymeme has joined #ocaml
Submarine has joined #ocaml
ttamttam has joined #ocaml
slash_ has quit [Quit: leaving]
slash_ has joined #ocaml
ikaros has joined #ocaml
<rwmjones>
matthieu_, just replied to your email on bitstring, although google groups seems to have munched it (for now anyhow)
<thelema>
rwmjones: ttamttam had the bitstring question earlier
<rwmjones>
ok I saw it ... should be fine afaik
{newbie} has quit [Read error: Operation timed out]
bzzbzz has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
sepp2k has joined #ocaml
ztfw has joined #ocaml
{newbie} has joined #ocaml
pimmhogeling has joined #ocaml
enthymeme has joined #ocaml
Alpounet has quit [Ping timeout: 256 seconds]
tmaedaZ is now known as tmaeda
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 245 seconds]
<ygrek>
rwmjones, btw bitstring.syntax doesn't have dependency on bitstring in META, is that intended?
<ygrek>
it is contrary to guidelines on cocan wiki and to common practice
<rwmjones>
ygrek, ummm ... I always throw my hands up in the air when there is a question about META files
<rwmjones>
they are voodoo, particularly when they involve syntax extensions
<rwmjones>
however if you want to send a patch ...
slash_ has quit [Quit: Lost terminal]
<ttamttam>
rwmjones: thanks. I just received it ;-)
<ttamttam>
About the META: I did some modifications locally, but tested only with the toplevel
<ttamttam>
from memory : remove unix.cma, bitstring.cma from archives lines
<ttamttam>
and added the dependency ygrek is suggesting
<ygrek>
I am testing it currently, pity that ocamlfind doesn't put quotes properly around arguments to -pp
<ygrek>
when printing I mean
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
slash_ has joined #ocaml
tmaeda has quit [Ping timeout: 264 seconds]
ReachingFarr has joined #ocaml
ulfdoz has joined #ocaml
_andre has quit [Quit: *puff*]
slash_ has quit [Quit: Lost terminal]
<ReachingFarr>
So ocamlc is giving me an syntax error on the line 54 at characters 0-0, when my file only has 53 lines. I assume I'm doing something exceedingly wrong. Any ideas?
<ygrek>
add -pp camlp4o - maybe the error will be better
tmaeda has joined #ocaml
<ygrek>
probably `in` after `let`, try adding ;; betweed toplevel definitions to pinpoint the error location
Accidus has quit [Remote host closed the connection]
<ReachingFarr>
This is what I get for writing my Ocaml code when I'm drunk. I have to redo all the crazy stuff I did later.
* Camarade_Tux
blames his eyes for not seeing the error :P
oc13 has quit [Ping timeout: 276 seconds]
ttamttam has quit [Quit: Leaving.]
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
drk-sd has joined #ocaml
Associat0r has quit [Quit: Associat0r]
matthieu_ has quit [Ping timeout: 260 seconds]
Submarine has quit [Ping timeout: 258 seconds]
slash_ has joined #ocaml
slash_ has quit [Client Quit]
jeddhaberstro has joined #ocaml
derdon has quit [Quit: derdon]
enthymeme has joined #ocaml
<rwmjones>
ygrek, trouble is, I have no way to evaluate if that is better than the existing :-(
<ygrek>
rwmjones, trust me :)
<rwmjones>
ReachingFarr, what's the Fedora problem? can you open a bug about it (http://bugzilla.redhat.com/) too as I'm a bit busy just at this minute
<rwmjones>
ygrek, I think I probably do
<ygrek>
don't you have ocamlfind installed?
<rwmjones>
yes, I always use ocamlfind
<rwmjones>
I just don't understand META files
<rwmjones>
I'll have a look, but it's going to be tomorrow, busy now
<ygrek>
so, create some simple test ml file, old META - you need `-package bitstring, bitstring.syntax` to compile correctly, new ones - only `-package bitstring.syntax`
<ygrek>
same goes for bitstring.persistent
<ygrek>
there is nothing hard in METAs - from the user level - just the notation to manage dependencies
slash_ has joined #ocaml
<ygrek>
ok
slash_ has quit [Quit: leaving]
slash_ has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
mutewit has quit [Quit: leaving]
slash_ has quit [Quit: leaving]
slash_ has joined #ocaml
WuJiang has quit [Ping timeout: 252 seconds]
joewilliams is now known as joewilliams_away
jcaose has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
mutewit has joined #ocaml
fremo___ has quit [Ping timeout: 260 seconds]
fremo_ has joined #ocaml
avsm1 has quit [Quit: Leaving.]
rwmjones has quit [Ping timeout: 256 seconds]
rwmjones has joined #ocaml
<sc30317>
why can I not do this?
pimmhogeling has quit [Ping timeout: 245 seconds]
<sc30317>
(* REMOVE THE LAST ELEMENT OF EACH ROW *)
<sc30317>
let last_element_remove(trainData)=
<sc30317>
for i = 0 to length(trainData) do
<sc30317>
List.nth (trainData) i
<sc30317>
done
<sc30317>
;;
<sc30317>
I get Exception: Failure "nth".
pimmhogeling has joined #ocaml
<thelema>
yes, you can't get element #10 of a 10-element list.
<thelema>
They're numbered 0 to 9
jcaose has quit [Remote host closed the connection]
boscop_ has quit [Read error: Connection reset by peer]