Examples of IDataSequence


Examples of stallone.api.datasequence.IDataSequence

        {
            System.out.println("CompactRandomClustering <datafile> <nclusters> <nrepeats>");
            System.exit(0);
        }

        IDataSequence data = dataNew.reader(args[0]).load();
        int nclusters = str.toInt(args[1]);
        int nrepeats = str.toInt(args[2]);

        CompactRandomClustering C = new CompactRandomClustering(nclusters, nrepeats);
        C.setInput(data);
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

        double dt = 0.1, gamma = 1, kT = 0.2;
        IIntegratorThermostatted langevin = dynNew.langevinLeapFrog(pot, masses, 0.1, gamma, kT);
        // run
        IDoubleArray x0 = doublesNew.arrayFrom(0,0);
        int nsteps = 100000, nsave = 10;
        IDataSequence seq = dyn.run(x0, langevin, nsteps, nsave);
       
        // TICA
        int lag = 1;
        TICA tica = new TICA(lag);
        tica.addData(seq);
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

        this.clusterMethodLeaves = _clusterMethodLeaves;       
       
        // first clustering
        _clusterMethodFull.setInput(_data);
        _clusterMethodFull.perform();
        IDataSequence centers = _clusterMethodFull.getClusterCenters();
        // assignment
        IDiscretization assignment = _clusterMethodFull.getClusterAssignment();
        micro2macro = cluster.discretize(data, assignment);
        // define leaves
        int nClusters = _clusterMethodFull.getNumberOfClusters();
        for (int i=0; i<nClusters; i++)
        {
            IDoubleArray leafCenter = centers.get(i);
            IIntArray leafIndexes = ints.findAll(micro2macro, i);
            leaves.add(new Leaf(leafIndexes));
        }
    }
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

        //System.out.println("New clusters: "+nPieces);
        //System.out.println("Reassignment table: "+IntArrays.toString(reassign));

        // assignment
        IDiscretization assignment = this.clusterMethodLeaves.getClusterAssignment();
        IDataSequence centers = this.clusterMethodLeaves.getClusterCenters();
        IIntArray micro2macroLeaf = cluster.discretize(subset, assignment);
        // update global assignment
        for (int i=0; i<leaf.indexes.size(); i++)
        {
            int globalIndex = leaf.indexes.get(i);
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

    }

    @Override
    public IDataSequence next()
    {
        IDataSequence res = loader.getSequence(itraj);
        itraj++;

        return (res);
    }
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

*/
public class HMMFactory
{
    private IDataSequence concat(List<IDataSequence> _obs, int maxsize)
    {
        IDataSequence res = null;
        int size = DataSequence.util.size(_obs);
        int interleaf = (int)Math.max(1, size / maxsize);
        return DataSequence.util.concat(_obs, interleaf);
    }
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

    }

    private IDoubleArray[] initialParametersGaussian1D(List<IDataSequence> _obs, int nstates)
    {
        // cluster data
        IDataSequence obscat = concat(_obs, nstates*1000);

        System.out.println("Data concatenated to size "+obscat.size());

        System.out.println("Clustering...");

        IClustering cluster = Cluster.util.densityBased(obscat, nstates);

View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

    {
        if (!eventBased)
            return(par.getTransitionMatrix().get(state1,state2));
        else
        {
            IDataSequence seq = obs.get(traj);
            int dt = (int)(seq.getTime(timeindex1+1)-seq.getTime(timeindex1));
            return matrixPower.getPowerElement(par.getTransitionMatrix(), dt, state1, state2);
        }
    }
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

        this.clusterMethodLeaves = _clusterMethodLeaves;       
       
        // first clustering
        _clusterMethodFull.setInput(_data);
        _clusterMethodFull.perform();
        IDataSequence centers = _clusterMethodFull.getClusterCenters();
        // assignment
        IDiscretization assignment = _clusterMethodFull.getClusterAssignment();
        micro2macro = cluster.discretize(data, assignment);
        // define leaves
        int nClusters = _clusterMethodFull.getNumberOfClusters();
        for (int i=0; i<nClusters; i++)
        {
            IDoubleArray leafCenter = centers.get(i);
            IIntArray leafIndexes = ints.findAll(micro2macro, i);
            leaves.add(new Leaf(leafCenter, leafIndexes));
        }
    }
View Full Code Here

Examples of stallone.api.datasequence.IDataSequence

        //System.out.println("New clusters: "+nPieces);
        //System.out.println("Reassignment table: "+IntArrays.toString(reassign));

        // assignment
        IDiscretization assignment = this.clusterMethodLeaves.getClusterAssignment();
        IDataSequence centers = this.clusterMethodLeaves.getClusterCenters();
        IIntArray micro2macroLeaf = cluster.discretize(subset, assignment);
        // update global assignment
        for (int i=0; i<leaf.indexes.size(); i++)
        {
            int globalIndex = leaf.indexes.get(i);
            int newClusterIndex = reassign[micro2macroLeaf.get(i)];
            micro2macro.set(globalIndex, newClusterIndex);
        }
        // create new leaves
        IIntArray[] newLeaveIndexes = new IIntArray[nPieces];
        for (int i=0; i<nPieces; i++)
        {
            newLeaveIndexes[i] = ints.findAll(micro2macroLeaf, i);
            // change local to global index
            for (int j=0; j<newLeaveIndexes[i].size(); j++)
                newLeaveIndexes[i].set(j, leaf.indexes.get(newLeaveIndexes[i].get(j)));
        }       
        // add other leaves to end
        leaves.set(leafIndex, new Leaf(centers.get(0), newLeaveIndexes[0]));
        for (int i=1; i<nPieces; i++)
        {
            leaves.add(new Leaf(centers.get(i), newLeaveIndexes[i]));
        }       
       
        System.out.print(
                " splitted indexes: "+leafIndex+" -> ("+IntsPrimitive.util.toString(reassign,",")+")"+
                "\n  nstates: "+leaf.indexes.size()+" -> (");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.