The University of Massachusetts Amherst

1. HG in R

R code to perform various batch and online computations in HG is available. This code can be used to find HG solutions for learning problems (with or without hidden structure), generate distributions over forms in different HG theories, and perform assorted online learning simulations.

Development is ongoing and comments, complaints, and bug reports are welcome. Please direct them to Robert Staubs.

Notes on how the gradients are derived. 

Please cite as: Staubs, Robert. 2011. Harmonic Grammar in R (hgR). Software package. Amherst, MA: University of Massachusetts Amherst. https://websites.umass.edu/hgr/

Code:

  • tableau.R — functionality for creating tableau objects and calculating distributions
  • solver.R — batch learning functionality (currently in MaxEnt only, Noisy HG planned)
  • learner.R — online learning functionality (temporarily unavailable)
  • serial MaxEnt — code, driver file example, and example data for learning in Serial MaxEnt

Example Files:

  • solvertest.R — example driver file for solver.R
  • manual.txt — example input file without hidden structure (based on an OT-Help 2 example file)
  • manual-hidden.txt — example input file with hidden structure