Not signed in (Sign In)

LiveSearch

Categories

  • News
  • Everything you need to know.
  • Recurring Events
  • Classes, venues, dances. Anything that swings on a weekly or monthl...
  • Special Events
  • Workshops, exchanges, invitationals, mini-exchanges. Whatever's hap...
  • Out of Town
  • Road trips, exchanges, and anything from anywhere that's not here.
  • Swing Instruction
  • Need to polish a few moves? Need to learn some moves to polish? Che...
  • Dance Talk
  • Music, moves, and inspiration. If it swings, talk about it here.
  • Meet 'n Greet
  • Stop by and introduce yourself. Get to know everyone. Just like a s...
  • [Almost] Anything Goes!
  • If there's life outside of swing, discuss it here.
  • Support
  • Bug reports, feature requests, all that.

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorFoehg
    • CommentTimeDec 12th 2007
     

    package edu.berkeley.nlp.classify.maxent;

    import java.util.Collection;
    import java.util.HashSet;
    import java.util.Random;
    import java.util.Set;
    import java.util.Vector;

    import edu.berkeley.nlp.data.Datum;
    import edu.berkeley.nlp.data.LabeledDatum;
    import edu.berkeley.nlp.math.DifferentiableFunction;
    import edu.berkeley.nlp.math.DoubleArrays;
    import edu.berkeley.nlp.math.GradientMinimizer;
    import edu.berkeley.nlp.math.IterationListener;
    import edu.berkeley.nlp.math.LBFGSMinimizer;
    import edu.berkeley.nlp.model.Learner;
    import edu.berkeley.nlp.util.Indexer;

    /**
    * Factory for training MaximumEntropyClassifiers.
    *
    * @author rah67
    *
    * @param <F> Feature type -- almost always a String
    * @param <L> Label (class) type
    */
    public class MaximumEntropyClassifierFactory<F, L> implements Learner<F, F, L> {
    private static final double DEFAULT_TOLERANCE = 1e-4;

    private static final double DEFAULT_SIGMA = 1.0;

    private static final int DEFAULT_ITERATIONS = 250;

    private double sigma;

    private int maxIterations;

    private double tolerance;

    public MaximumEntropyClassifierFactory() {
    this(DEFAULT_SIGMA, DEFAULT_ITERATIONS, DEFAULT_TOLERANCE);
    }

    public MaximumEntropyClassifierFactory(double sigma, int maxIterations) {
    this(sigma, maxIterations, DEFAULT_TOLERANCE);
    }

    /**
    * Sigma controls the variance on the prior / penalty term. 1.0 is a
    * reasonable value for large problems, bigger sigma means LESS smoothing.
    * Zero sigma is a special indicator that no smoothing is to be done.
    * <p/>
    * Iterations determines the maximum number of iterations the optimization
    * code can take before stopping.
    */
    public MaximumEntropyClassifierFactory(double sigma, int maxIterations, double tolerance) {
    this.sigma = sigma;
    this.maxIterations = maxIterations;
    this.tolerance = tolerance;
    }

    public MaximumEntropyClassifier<F, L> trainModel(Collection<? extends Datum<F>> trainingData) {
    return trainModel(trainingData, null);
    }

    /**
    * Trains a maximum entropy model. Before data is passed to this method
    * the features should already have been extracted using a FeatureExtractor
    */
    public MaximumEntropyClassifier<F, L> trainModel(
    Collection<? extends Datum<F>> trainingData,
    Collection<? extends Datum<F>> validationData) {
    Collection<LabeledDatum<F, L>> lTrainingData = (Collection<LabeledDatum<F, L>>[Emoticon not found] trainingData;
    Collection<LabeledDatum<F, L>> lValidationData = (Collection<LabeledDatum<F, L>>[Emoticon not found] validationData;

    // build data encodings so the inner loops can be efficient
    // TODO talk to Dan W. about encodings
    Encoding<F, L> encoding = buildEncoding(lTrainingData, lValidationData);
    IndexLinearizer indexLinearizer = new IndexLinearizer(encoding.getNumFeatures(), encoding.getNumLabels());
    // TODO if we ever optimize theta, than we will have to fold validation later
    EncodedDatum[] encodedData = encodeData(lTrainingData, lValidationData, encoding);
    return trainModel(encodedData, encoding, indexLinearizer);
    }

    /**
    * @param encodedData
    * @param encoding
    * @param indexLinearizer
    * @return
    */
    public MaximumEntropyClassifier<F, L> trainModel(EncodedDatum[] encodedData, Encoding<F, L> encoding, IndexLinearizer indexLinearizer) {
    // build a minimizer object
    GradientMinimizer minimizer = new LBFGSMinimizer(maxIterations, iterationListenerList);
    // build the objective function for this data
    DifferentiableFunction objective = new ObjectiveFunction<F, L>(
    encoding, encodedData, indexLinearizer, sigma);
    // learn our voting weights
    double[] initialWeights = buildInitialWeights(encoding, indexLinearizer);
    double[] weights = minimizer.minimize(objective, initialWeights,
    tolerance);
    // build a classifer using these weights (and the data encodings)
    return new MaximumEntropyClassifier<F, L>(weights, encoding, indexLinearizer);
    }

    private Vector<IterationListener> iterationListenerList = new Vector<IterationListener>();
    public void addIterationListener(IterationListener l) {
    iterationListenerList.add(l);
    }

    public void removeIterationListener(IterationListener l) {
    iterationListenerList.remove(l);
    }

    protected double[] buildInitialWeights(Encoding<F, L> encoding, IndexLinearizer indexLinearizer) {
    // double[] weights = new double[indexLinearizer.getNumLinearIndexes()];
    // Random random = new Random();
    // for(int i = 0; i < weights.length; i++) {
    // weights[i] = random.nextDouble() * perturbationFactor - perturbationFactor / 2.0;
    // }
    // return weights;
    // return DoubleArrays.constantArray(0.0, indexLinearizer.getNumLinearIndexes());
    return new double[indexLinearizer.getNumLinearIndexes()];
    }

    public static <F, L> Encoding<F, L> buildEncoding(
    Collection<LabeledDatum<F, L>> trainingData) {
    return buildEncoding(trainingData, null);
    }

    public static <F, L> Encoding<F, L> buildEncoding(
    Collection<LabeledDatum<F, L>> trainingData,
    Collection<LabeledDatum<F, L>> validationData) {
    Indexer<F> featureIndexer = new Indexer<F>();
    Indexer<L> labelIndexer = new Indexer<L>();
    index(trainingData, labelIndexer, featureIndexer);
    if (validationData != null)
    index(validationData, labelIndexer, featureIndexer);
    return new Encoding<F, L>(featureIndexer, labelIndexer);
    }

    private static <F, L> void index(Collection<LabeledDatum<F, L>> trainingData, Indexer<L> labelIndexer, Indexer<F> featureIndexer) {
    for (LabeledDatum<F, L> labeledDatum : trainingData) {
    labelIndexer.add(labeledDatum.getLabel());
    for (F feature : labeledDatum.getFeatures()) {
    featureIndexer.add(feature);
    }
    }
    }

    public static <F, L> EncodedDatum<F, L>[] encodeData(
    Collection<LabeledDatum<F, L>> trainingData,
    Encoding<F, L> encoding) {
    return encodeData(trainingData, null, encoding);
    }

    public static <F, L> EncodedDatum<F, L>[] encodeData(
    Collection<LabeledDatum<F, L>> trainingData,
    Collection<LabeledDatum<F, L>> validationData, Encoding<F, L> encoding) {
    int size = trainingData.size();

    if (validationData != null)
    size += validationData.size();

    EncodedDatum[] encodedData = new EncodedDatum[size];
    int i = 0;
    for (LabeledDatum<F, L> labeledDatum : trainingData) {
    encodedData[i++] = EncodedDatum.encodeLabeledDatum(labeledDatum, encoding);
    }
    if (validationData != null) {
    for (LabeledDatum<F, L> labeledDatum : validationData) {
    encodedData[i++] = EncodedDatum.encodeLabeledDatum(labeledDatum, encoding);
    }
    }
    return encodedData;
    }

    /**
    * @return the iterations
    */
    public int getMaxIterations() {
    return maxIterations;
    }

    /**
    * @param iterations the iterations to set
    */
    public void setMaxIterations(int iterations) {
    this.maxIterations = iterations;
    }

    /**
    * @return the sigma
    */
    public double getSigma() {
    return sigma;
    }

    /**
    * @param sigma the sigma to set
    */
    public void setSigma(double sigma) {
    this.sigma = sigma;
    }

    /**
    * @return the tolerance
    */
    public double getTolerance() {
    return tolerance;
    }

    /**
    * @param tolerance the tolerance to set
    */
    public void setTolerance(double tolerance) {
    this.tolerance = tolerance;
    }

    /**
    * @return the perturbationFactor
    */
    /* public double getPerturbationFactor() {
    return perturbationFactor;
    }
    */
    /**
    * @param perturbationFactor the perturbationFactor to set
    */
    /* public void setPerturbationFactor(double perturbationFactor) {
    this.perturbationFactor = perturbationFactor;
    }
    */
    }

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 12th 2007
     

    60.30

    •  
      CommentAuthorFoehg
    • CommentTimeDec 12th 2007
     

    %s/[.,;"'?!a-zA-Z_01-9()-]//g

    •  
      CommentAuthorFoehg
    • CommentTimeDec 12th 2007
     

    ’¶°Ô±¸¸§ (Çѱ’&#960;ö·Â¿øÀÚ·Â CF&#960;Û) - À哪¶ó

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 12th 2007
     

    // make sure the dynamic dialog box is open
    dialog.say('dynamicd',{pos:3,dir:'r'});
    }

    •  
      CommentAuthorFoehg
    • CommentTimeDec 13th 2007
     

    -Xms256m -Xmx1024m

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 13th 2007
     
    •  
      CommentAuthortraci
    • CommentTimeDec 13th 2007
     

    8309

    •  
      CommentAuthorFoehg
    • CommentTimeDec 15th 2007
     
    •  
      CommentAuthorBuzz
    • CommentTimeDec 16th 2007
     

    Router IP Address 192.168.25.1
    Subnet Mask 255.255.255.0
    DHCP 192.168.25.50 - 99
    Wireless

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 16th 2007
     

    call2actionContact

    •  
      CommentAuthorThe Cap'n
    • CommentTimeDec 27th 2007
     

    ''Cal Values for DIGMFP1.0FLUX20071026B
    'In Site SB
    SDI12Recorder (temp_var,7,0,"XSCS1+00.99743!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCT1+00.34858!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCS2+00.99769!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCT2+00.43251!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCS3+01.00032!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCT3+00.27906!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCS4+00.99652!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCT4+00.43861!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCR1+06.09113!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCR2+06.36669!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCR3+06.29468!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSCR4+06.23098!",1.0,0)
    SDI12Recorder (temp_var,7,0,"XSIFM+00.69820!",1.0,0)

    SDI12Recorder (Probe_ID,7,0,"I!",1.0,0)

    SDI12Recorder (R(1),7,0,"XRCR1!",1.0,0)
    SDI12Recorder (R(2),7,0,"XRCR2!",1.0,0)
    SDI12Recorder (R(3),7,0,"XRCR3!",1.0,0)
    SDI12Recorder (R(4),7,0,"XRCR4!",1.0,0)
    SDI12Recorder (T(1),7,0,"XRCT1!",1.0,0)
    SDI12Recorder (T(2),7,0,"XRCT2!",1.0,0)
    SDI12Recorder (T(3),7,0,"XRCT3!",1.0,0)
    SDI12Recorder (T(4),7,0,"XRCT4!",1.0,0)
    SDI12Recorder (S(1),7,0,"XRCS1!",1.0,0)
    SDI12Recorder (S(2),7,0,"XRCS2!",1.0,0)
    SDI12Recorder (S(3),7,0,"XRCS3!",1.0,0)
    SDI12Recorder (S(4),7,0,"XRCS4!",1.0,0)
    SDI12Recorder (C_s,7,0,"XRIFM!",1.0,0)

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 27th 2007
     

    and these:

    • CommentAuthorSwingSis
    • CommentTimeDec 27th 2007
     

    Zuni bear fetish earrings

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 28th 2007
     

    list-style-image: none;

    •  
      CommentAuthorBuzz
    • CommentTimeDec 28th 2007
     

    secure/processBooking.aspx

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 28th 2007
     

    shelven

    •  
      CommentAuthorFoehg
    • CommentTimeDec 29th 2007
     

    Sunday Monday Tuesday Wednesday Thursday Friday Saturday
    December 2008
    1 2 3 4 5 6
    7 8 9 10 11 12 13
    14 15 16 17 18 19 20
    21 22 23 24 25 26 27
    28 29 30 31

    •  
      CommentAuthorbobthecow
    • CommentTimeDec 30th 2007
     
    •  
      CommentAuthorThe Cap'n
    • CommentTimeJan 7th 2008
     

    unsigned char temp = RXdata;

    •  
      CommentAuthorbobthecow
    • CommentTimeJan 7th 2008
     

    #CF1A1C

    •  
      CommentAuthorFoehg
    • CommentTimeJan 7th 2008
     

    84604

    •  
      CommentAuthorbobthecow
    • CommentTimeJan 7th 2008
     

    castleworks great danes

    •  
      CommentAuthorSpecialK
    • CommentTimeJan 8th 2008
     
    •  
      CommentAuthorFoehg
    • CommentTimeJan 8th 2008
     
    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 1st 2008 edited
     

    die('brb.');

    end rescale_and_save

    •  
      CommentAuthorFoehg
    • CommentTimeFeb 11th 2008
     
    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 11th 2008
     

    defaults write com.apple.dock no-glass -boolean YES

  1.  

    VISUAL DIFFERENCE AND VARIETY IN INTERPRETATION ANALYSIS

    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 11th 2008
     
  2.  

    is the data stored on S3

    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 13th 2008
     

    styk143

    •  
      CommentAuthorSpecialK
    • CommentTimeFeb 14th 2008
     

    NZJDDH

    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 14th 2008 edited
     

    <i hit paste, and it was someone else's letter of intent. i'll do them a favor and not post it to the forum.>

    •  
      CommentAuthorBags
    • CommentTimeFeb 17th 2008
     
    • CommentAuthordrfindley
    • CommentTimeFeb 18th 2008
     

    gumby

    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 18th 2008
     
  3.  

    1 Facebook Follies (opener)
    2 Letters to the Editor (Amy is upset)
    3 New Years Res (Matt steals a wheel-chair)
    4 Roommate Breakup (Sarah finds a new contract and leaves Laurel)
    5 Bookstore buyback (Natalie does terrible things to books)
    6 Pick up lines (Nick and Mary)
    7 YW in Mediocrity (all the girls!)
    8 Now that's what I call… (Jeff's magical moments)
    9 Catty Nice Girls (Natalie and Sarah)
    10 Oregon Trail (need we say more?)
    11 Pick up lines (Nick and Mary again)
    12 Victoria Secret objects (VS does household objects)
    13 Valentine Scrooge (Laurel hates Valentine's Day)
    14 Soap Opera (As the Pendulum turns)
    15 Celebrity Students (Natalie is famous)
    16 Roomate from H (Scott's a jerk to Nick)
    17 Pick up lines (Nick and Mary)
    18 Pepto (Jeff dresses in pink)
    19 Dance with Me (Brian asks Laurel to a dance by...dancing!)
    20 Don't bother me… (Video that grossed-out the feeble-hearted)
    21 Back to the future (Headliner!)

    •  
      CommentAuthorSpecialK
    • CommentTimeFeb 23rd 2008
     

    21:40:27
    Saturday
    23/02/08

    •  
      CommentAuthorbobthecow
    • CommentTimeFeb 23rd 2008
     

    That's crazy awesome. Lots of camera angles mean lots of takes, and there are a couple of times when the tap doesn't sync with the sound. He also must have anchored those drums well for his kicks. wow

  4.  

    <my friend's email address>

  5.  

    April 12: Utah Girls’ Jam

    •  
      CommentAuthorbobthecow
    • CommentTimeMar 1st 2008
     

    good question. i'll ask my connection

    •  
      CommentAuthorFoehg
    • CommentTimeMar 3rd 2008
     

    "This is the trouble with being a newly qualified vet"

    •  
      CommentAuthorbobthecow
    • CommentTimeMar 3rd 2008
     
    •  
      CommentAuthorSpecialK
    • CommentTimeMar 4th 2008
     
    •  
      CommentAuthorbobthecow
    • CommentTimeMar 4th 2008
     

    http://tinyurl.com/ypoqn4

    (apparently i haven't copied anything since last time...)

  6.  

    " "

    Seriously, I have a completely OCD habit of clearing the clipboard with a single space. I'm insane.

  7.  
    •  
      CommentAuthorbobthecow
    • CommentTimeMar 6th 2008
     

    twitter homogenized