Christophe.Cerisara | 5 Jan 2012 12:44
Picon
Favicon

Question collapsing

Dear HBC developer,

First of all, thanks a lot for this impressive software !
I just started testing it, and I have a (probably) stupid question, 
about collapsing
the parameters of a variable with several parents, which just fails ?
I probably just didn't understood all this well enough, but here is my 
code:

(I'm very sorry if the answer is in the archives of the list, but I 
didn't find any search box)

Thanks a lot !
Bests,
Christophe

alphaZ ~ Gam(1,1)
alphaY ~ Gam(1,1)
alphaW ~ Gam(0.1,1)
thetaZ ~ DirSym(alphaZ, K)
thetaY ~ DirSym(alphaY, L)
thetaW_{k,l} ~ DirSym(alphaW, VW) , k \in [1,K] , l \in [1,L]
z_{n} ~ Mult(thetaZ) , n \in [1,N]
y_{n} ~ Mult(thetaY) , n \in [1,N]
w_{n} ~ Mult(thetaW_{z_{n},y_{n}}) , n \in [1,N]

--# --define K 20
--# --define L 20
--# --define alphaZ 1.0
--# --loadD enW w VW N ;
(Continue reading)

Matthew Gerber | 30 Sep 2011 05:33
Favicon

Error when running HBC - no solution found on Internet

Hello,

I am trying to compile and run HBC, but I'm failing miserably. I am doing this on Debian 6.0.1 (Squeeze) with version 6.8.2 of GHC (released 12 December 2007):

=====
$ /opt/ghc-6.8.2/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
=====

Here is the output when compiling HBC (only the warning is shown):

=====
$ /opt/ghc-6.8.2/bin/ghc --make -fglasgow-exts -O2 Main.hs -o hbc
...
[20 of 23] Compiling Simulate         ( Simulate.hs, Simulate.o )

Simulate.hs:820:0:
    Warning: No explicit method nor default method for `DAB.getNumElements'
    In the instance declaration for `MArray a e (StateT s m)'
...
=====

When I simulate the included LDA model, I get the following:

=====
$ ./hbc simulate --define K 2 --loadD testW w V D N ';' --iter 10 --dump best z ';' --define alpha 1 --define eta 1 LDA.hier
     __  ____   ____
    / / / /  \ / __/  HBC: The Hierarchical Bayes Compiler
   / /_/ / / // /     http://hal3.name/HBC/
  / __  / --</ /     
 / / / / /  / /___    Version 0.7 beta
 \/ /_/____/\____/   

Loading module LDA.hier
Building core module
Adding functions...
Defining passed-in variables...
Running other initializations...
hbc: Simulate.hs:820:0: No instance nor default method for class operation Data.Array.Base.getNumElements
=====

Does anyone have any insight into this problem? Can anyone suggest a GHC version that produces a working HBC?

Many thanks!
Matt Gerber

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Alireza Mahani | 22 Feb 2011 18:46
Favicon

Inner product syntax for .hier file?

Hello all,

 

Is there a syntax for forming an inner product of two vectors in the .hier file? As you can imagine, regression models most often require one to form an inner product of a weight/parameter vector with an observation vector, and having this syntax greatly simplifies the script. In .bug files (JAGS , WINBUG, etc), one can specify inprod(vec1[1:N], vec2[1:N]), and I wonder if there is a similar feature in HBC.

 

Thank you,

Ali

 

-----------------------------------------------------

Alireza S Mahani, Ph.D.

Quantitative Modeling Group

Sentrana, Inc

1725 Eye Street, Suite 900

Washington, DC 20006

202-507-4524

www.sentrana.com

 

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Alireza Mahani | 5 Jan 2011 22:50
Favicon

Comparison of HBC and JAGS

Hi all,

 

Today I compared the performance of HBC vs. JAGS using the Mixture-of-Gaussians example from HBC as the benchmarking problem. I used 100,000 iterations for both runs. It took 68sec for HBC and 32sec for JAGS. In other words, JAGS was twice as fast. I don’t care about absolute numbers, but about relative performance. Since HBC is compiled code while JAGS is interpreted, I expected to see significantly better results on HBC. Clearly, this didn’t happen.

 

While I can think of several possible explanations, I wanted to put this out to everyone else who might have done similar benchmarking work and get their feedback.

 

Regards,

Ali

----------------------------------------------------

Alireza S Mahani, Ph.D.

Sentrana Quantitative Modeling Group

202-507-4524

www.sentrana.com

 

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Alireza Mahani | 29 Dec 2010 00:47
Favicon

Compiling HBC in Windows 7

Hi,

 

I’ve been getting the familiar GenC.hs:153:37: problem while trying to compile HBC.exe using the HBC 6.12 build. I read in the previous posts that this is caused by newer GHC builds, and that using the 6.6 version can remove the issue. However, I’m not sure how to install the older 6.6 version: When I read the website http://www.haskell.org/ghc/download_ghc_66 it’s not clear whether any of the windows packages will be compatible with Windows 7 or not.

 

I would appreciate any suggestions / guidance for how to best deal with this error.

 

Regards,

Ali Mahani

----------------------------------------------------

Alireza S Mahani, Ph.D.

Sentrana Quantitative Modeling Group

202-507-4524

www.sentrana.com

 

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
mrinmaya sachan | 5 Dec 2010 18:31
Picon

hbc copilation problem

ghc --make --fglasgow-exts Main -o hbc

Error:
Code.opt.hs:33:8:
Could  not find module 'Data.Generics.Schemes'

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Nachiketa Sahoo | 12 Jul 2010 14:55
Picon

a clarification

Hi,

I was wondering if there is any updated manual for the HBC. In the
current form, on page 7, section 4, in the table--the first
distribution seems like it should be Bernoulli in stead of Binomial.
Right?

Thanks,
Nachi
Enzo Acerbi | 9 Jul 2010 14:11
Picon

reading from two different input files

Hi all,
I'm new to HBC, i find it very powerfull and usefull!
My question is quite simple: can i read from two different input files using the --loadD command?
I'm not able to do this, and i can't figure out if it's my fault or if the tool doesn't permits this kind of operation

Thanks in advance!
 

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Tanmoy | 24 May 2010 06:53
Picon

Re: Issues in GenC.hs

Hi,
   Getting the following error even after following the link. Let me know where am i going wrong.

Sincerely
Tanmoy Mukherjee

On Sat, May 22, 2010 at 5:25 PM, Chung-chieh Shan <ccshan <at> rutgers.edu> wrote:
On 2010-05-22T05:27:47+0100, Tanmoy wrote:
> Hi Shan,
>             Thanks a lot. Well i fixed that issue. Here is a new one coming
> in at Main.hs
> Main.hs:418:2:
>                      Ambiguous type variable `e1' in the constraint:
>                      `Exception e1' arising from a use of `runMain'' at
> Main.hs:418:2-83
>                  Probable fix: add a type signature that fixes these type
> variable(s)
> Same issue at Main.hs:440:13 with variable e'.
>
> Any answers ?

The fix at
http://github.com/luispedro/HBC/commit/30c313cb2650c6dbf0edc367c2fe2d1e29678295
seems promising...

--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
I calculated the odds of succeeding, and then the odds of doing something
incredibly stupid, and then I went ahead with it anyway.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFL+AWDzjAc4f+uuBURAqOPAKCM8roYICv5w9K5RjxjBawGU/WQMwCdEIwt
RrSKvjgFD6MeF483rycuLXI=
=fGO0
-----END PGP SIGNATURE-----




--
Tanmoy Mukherjee
Attachment (1): application/octet-stream, 1172 bytes
_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Tanmoy | 21 May 2010 09:34
Picon

Issues in GenC.hs

Hi,
   Been trying to compile GenC.hs and am getting the following errors
GenC.hs 154:37
                      Couldn't match expected type `[t]'
                                 against inferred type `Maybe Type'
                      In the first argument of `mplus', namely `M.lookup v' tm'
                      In the expression: M.lookup v' tm `mplus` M.lookup v' etm
                      In a stmt of a list comprehension:
                          t<-M.lookup v' tm `mplus` M.lookup v' etm

Could any one help me with this issue ?

Sincerely
Tanmoy Mukherjee

_______________________________________________
hbc mailing list
hbc@...
http://mailman.cs.utah.edu/mailman/listinfo/hbc
Sumit Negi | 18 May 2010 15:20
Picon

HBC-version0.6 -- cannot dump state of beta


Hi

Thanks for creating this wonderful piece of code . .  Currently we are
using the HBC-0.6 version code-base.

We are trying to run the given LDA example.

alpha     ~ Gam(0.1,1)
eta       ~ Gam(0.1,1)
beta_{k}  ~ DirSym(eta, V)           , k \in [1,K]
theta_{d} ~ DirSym(alpha, K)         , d \in [1,D]
z_{d,n}   ~ Mult(theta_{d})          , d \in [1,D] , n \in [1,N_{d}]
w_{d,n}   ~ Mult(beta_{z_{d,n}})     , d \in [1,D] , n \in [1,N_{d}]

During the run we tried to dump the value of the beta variable but couldn't
do so . The output looks like this .

[root <at> bao-sandbox hbc_v0_6_linux]# ./hbc simulate --define K 2 --loadD
testW w V D N ';' --dump best beta ';'  --iter 10  LDA.hier
     __  ____   ____
    / / / /  \ / __/  HBC: The Hierarchical Bayes Compiler
   / /_/ / / // /     http://hal3.name/HBC/
  / __  / --</ /
 / / / / /  / /___    Version 0.6 beta
 \/ /_/____/\____/

Loading module LDA.hier
Building core module
Adding functions...
Defining passed-in variables...
Running other initializations...
Beginning sampling...
iter 1  ll -350.5480209310406
iter 2  ll -317.2166802279221
iter 3  ll -286.0475837192772
iter 4  ll -252.23998142693694
iter 5  ll -233.2830026127565
iter 6  ll -233.2830026127565
iter 7  ll -233.2830026127565
iter 8  ll -233.2830026127565
iter 9  ll -233.2830026127565
iter 10 ll -233.2830026127565
== SAMPLE       -233.2830026127565

Dump for other variables such as  z , alpha works fine.

Please suggest

Thanks
With Regards
Sumit

Gmane