Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
train a neural net with these data. On Tue, Jul 5, 2016 at 12:43 PM, Andre Bieler wrote: > Can you tell me what you will be doing with this tree after everything is > set up correctly?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Can you tell me what you will be doing with this tree after everything is set up correctly?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
the objective is to get 100 (leafs) vectors (which are not equal in length) of data from child and root. initial data is in the root then the data is divided between childs (the size of each vector may varies from 1 child to another) each child share it's data with its own leaf (the size of each

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Ahmed, is it necessary that the data is stored in all 3 levels? (root has data, child has data, leaf has data) Is it not good enough if the data is stored in the leafs only? Maybe you can explain what your "end goal" is?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
But l have encountered a problem when distributing data from root to child then to leafs. l'm looking for something like this: *level 0root : *data= rand(1) # generate 1 random values *level 1 10 child * for each child attribute a certain number of generated values ,

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
hello, l fixed the problem by adding a function called data_node() as follows : function data_node(node) println("data : ", node.data) println("index ", node.index) end for i in 1:nChildren for k in 1:root.child[i].nchild data_node(root.child[i].child[k]) end end On Monday, July

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-04 Thread Ahmed Mazari
The idea that comes to my mind is the following : add a new variable to MyNode type wich is index, type MyNode{T} data::Vector{T} level::Int child :: Vector{MyNode} nchild :: Int index :: Int end function node_info(node) println("Level: ", node.level)

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-04 Thread Andre Bieler
Well for 1) this is pretty much exactly what is being done in my example code. The difference is that it prints out the content of "data". (But I put the index of each child into that "data" varialbe) My suggestion is that you insert a new field in the MyNode type, this variable can then hold

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-04 Thread Ahmed Mazari
Hello Andre thantk you a lot , when l run the code l think it's gives what l'm looking for. but l have trouble to understand the code in order to add the following instruction : 1) l need to print a list of leaf of each child by retrieving the indexes : for example child 1 : [leaf 1, leaf 5 , ]

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-03 Thread Andre Bieler
and maybe someday I will be smart enough for syntax highlighting... maybe..

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-03 Thread Andre Bieler
Hi Ahmed, sorry for the late answer, but it is a busy weekend... I am not sure I understand your question, but the following for loop connects the leafs to the children. for i in 1:nChildren root.child[i].child = all_leafs[i] end Here a full example code where some information is printed in the

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Ahmed Mazari
l don't understand your code!! how do you connect each child to its leafs ? On Fri, Jul 1, 2016 at 4:42 PM, Ahmed Mazari wrote: > ha you should just reply from the google group rather than from your > inbox mail. then click on { } to highlight the syntax > > On Fri,

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Ahmed Mazari
ha you should just reply from the google group rather than from your inbox mail. then click on { } to highlight the syntax On Fri, Jul 1, 2016 at 4:38 PM, Andre Bieler wrote: > ah for &^%$@@ sake how do you enable syntax highlighting?? I thought > ```julia would do

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Ahmed Mazari
1) yes they are of the same type as root and child . the leaf is the last level of the tree so it doesn't have any child 2) yes no children with zero leaf at least one leaf On Fri, Jul 1, 2016 at 4:37 PM, Andre Bieler wrote: > I think I start seeing what you want. A

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
ah for &^%$@@ sake how do you enable syntax highlighting?? I thought ```julia would do the trick?? If you tell me the secret I can re-post my previous message more nicely :)

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
I think I start seeing what you want. A few questions: 1) Can the leafs be of the same type as the root and child? 2) Does every child need to have one child at least? (= no child with zero leafs) you can do the following: ```julia # this generates a list of empty vectors that can hold MyNode

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Ahmed Mazari
Let's define the function that allows to associate randomly a certain number of leafs for each child under a constraint : the total number of leafs is 100 and the function that allows to add_link between each child with its leafs. Please don't hesitate to modify the code, there is some

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
Well the child can also have children, just like in your graph you attached. This is then one level down in your graph. Note that the root is of the same type as the children. (MyNode can be parent, child, grandchild etc.) The children are just put inside the root. Then you can continue and

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Ahmed Mazari
hi, l don't understand what you're doing here. add_children!() need to have as a parameter a root (node parent) not child, isn't it ? *for child in root.child* * add_children!(child, 10)* *end* On Wednesday, June 29, 2016 at 4:53:55 PM UTC+2, Ahmed Mazari wrote: > > Hello , > > > I need to

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-06-30 Thread Ahmed Mazari
On Thursday, June 30, 2016 at 2:12:30 PM UTC+2, Ahmed Mazari wrote: > > Hi Andre. > You will fnd attached my files and a picture that illustrates the tree > structure l'm looking for. > file 1 : somme comments on your codes > file 2 : my code to be improved. > > For the part of your code. We

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-06-30 Thread Ahmed Mazari
Hi Andre. You will fnd attached my files and a picture that illustrates the tree structure l'm looking for. file 1 : somme comments on your codes file 2 : my code to be improved. For the part of your code. We should add child, number of child and data. the structure seems to be appropriate from

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-06-29 Thread Andre Bieler
Not very elegant, but maybe something like this? type MyNode level::Int nLeafs::Int leafs::Vector{MyNode} end MyNode() = MyNode(0,0,MyNode[]) N = 100 root = MyNode(0,N, [MyNode() for i in 1:N]) then you can go on and define the 1st level with a for loop and so on. Because it is