Hey Yichao, it's late here, I will continue tomorrow. Thanks for your help!

> On Nov 23, 2016, at 22:59, Yichao Yu <yyc1...@gmail.com> wrote:
> 
>> On Wed, Nov 23, 2016 at 7:31 PM, Kevin Liu <kvt...@gmail.com> wrote:
>> In `permute_dims = [Remain_dims,Remove_dims]`, both Remain and Remove_dims
> 
> Which is why it is wrong.
> 
>> are vectors. Even if I `permute_dims = [Remain_dims]`, I still get the same
>> error.
> 
> 
> julia> [[1]]
> 1-element Array{Array{Int64,1},1}:
> [1]
> 
> julia> [[1];]
> 1-element Array{Int64,1}:
> 1
> 
> 
>> 
>>> On Wed, Nov 23, 2016 at 9:54 PM, Yichao Yu <yyc1...@gmail.com> wrote:
>>> 
>>>> On Wed, Nov 23, 2016 at 6:50 PM, Kevin Liu <kvt...@gmail.com> wrote:
>>>> Attached!
>>> 
>>> ```
>>> help?> permutedims
>>> search: permutedims permutedims! ipermutedims
>>> 
>>>  permutedims(A, perm)
>>> 
>>>  Permute the dimensions of array A. perm is a vector specifying a
>>> permutation
>>>  of length ndims(A). This is a generalization of transpose for
>>>  multi-dimensional arrays. Transpose is equivalent to permutedims(A,
>>> [2,1]).
>>> 
>>>  julia> A = reshape(collect(1:8), (2,2,2))
>>>  2×2×2 Array{Int64,3}:
>>>  [:, :, 1] =
>>>   1  3
>>>   2  4
>>>  <BLANKLINE>
>>>  [:, :, 2] =
>>>   5  7
>>>   6  8
>>> 
>>>  julia> permutedims(A, [3, 2, 1])
>>>  2×2×2 Array{Int64,3}:
>>>  [:, :, 1] =
>>>   1  3
>>>   5  7
>>>  <BLANKLINE>
>>>  [:, :, 2] =
>>>   2  4
>>>   6  8
>>> ```
>>> 
>>> You are not giving `permutedims` the correct second parameters
>>> 
>>> (https://github.com/hpoit/MLN.jl/blob/1c13725666f34587e57c4a1757e6222cacaeab73/BN/src/FactorOperations.jl#L66).
>>> 
>>> 
>>>> 
>>>>> On Wed, Nov 23, 2016 at 9:44 PM, Yichao Yu <yyc1...@gmail.com> wrote:
>>>>> 
>>>>>> On Wed, Nov 23, 2016 at 4:02 PM, Kevin Liu <kvt...@gmail.com> wrote:
>>>>>> Yichao, would you give me some direction? I am a bit lost.
>>>>> 
>>>>> Post and/or identify the error after you've fixed the `Factor.` problem
>>>>> 
>>>>>> 
>>>>>>> On Tue, Nov 22, 2016 at 7:58 PM, Kevin Liu <kvt...@gmail.com> wrote:
>>>>>>> 
>>>>>>> Do you want a cut in the profits for helping me get it to work? It's
>>>>>>> a
>>>>>>> marathon. I still have Markov Random Field and Markov Logic Network
>>>>>>> in
>>>>>>> line... and two of the largest private Brazilian banks on standby.
>>>>>>> 
>>>>>>>>> On Nov 22, 2016, at 19:39, Yichao Yu <yyc1...@gmail.com> wrote:
>>>>>>>>> 
>>>>>>>>> On Tue, Nov 22, 2016 at 4:23 PM, Kevin Liu <kvt...@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>> I would like to remove variable "c" from factor C. I tried
>>>>>>>>> removing
>>>>>>>>> `Factor.` but it didn't work.
>>>>>>>> 
>>>>>>>> There might be (almost certainly) multiple mistakes in the code so
>>>>>>>> fixing one won't fix all of them.
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> On Tue, Nov 22, 2016 at 6:54 PM, Yichao Yu <yyc1...@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>>> On Tue, Nov 22, 2016 at 3:45 PM, Kevin Liu <kvt...@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>> Yichao, I used a hashtag in the last message to show you what I
>>>>>>>>>>> want
>>>>>>>>>>> to
>>>>>>>>>>> do. Is it clear?
>>>>>>>>>> 
>>>>>>>>>> No
>>>>>>>>>> 
>>>>>>>>>> I'm just talking about the `Factor.` in the line I linked. I
>>>>>>>>>> don't
>>>>>>>>>> know what you want to access. Do you just want `FactorMargin`?
>>>>>>>>>> What's
>>>>>>>>>> the extra `Factor.` for?
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> On Nov 22, 2016, at 18:27, Yichao Yu <yyc1...@gmail.com> wrote:
>>>>>>>>>>> 
>>>>>>>>>>>>> Yichao and DPSanders, I have already used instances of Factor
>>>>>>>>>>>>> on
>>>>>>>>>>>>> runtests.jl, instances A, B, and C
>>>>>>>>>>>> 
>>>>>>>>>>>> AFAICT you are still accessing a non existing field of a
>>>>>>>>>>>> type[1]
>>>>>>>>>>>> and
>>>>>>>>>>>> it's unclear what you actually want to do.
>>>>>>>>>>>> 
>>>>>>>>>>>> [1]
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> https://github.com/hpoit/MLN.jl/blob/1c13725666f34587e57c4a1757e6222cacaeab73/BN/src/FactorOperations.jl#L87
>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> A=Factor(["a", "b"],[3, 2],[0.5, 0.1, 0.3, 0.8, 0, 0.9])
>>>>>>>>>>>>> B=Factor(["b", "c"],[2, 2],[0.5, 0.1, 0.7, 0.2])
>>>>>>>>>>>>> C = FactorProduct(A, B)
>>>>>>>>>>>>> FactorDropMargin(C, ["c"])
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Do you recommend I make any of the functions in
>>>>>>>>>>>>> FactorOperations.jl
>>>>>>>>>>>>> into inner constructors of `type Factor` in Factor.jl?
>>>>>>>>> 
>>>>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
>> 

Reply via email to