Package hivemall.mix.MixMessage

Examples of hivemall.mix.MixMessage.MixEventName


        this.scale = scale;
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MixMessage msg) throws Exception {
        final MixEventName event = msg.getEvent();
        switch(event) {
            case average:
            case argminKLD: {
                PartialResult partial = getPartialResult(msg);
                mix(ctx, msg, partial);
View Full Code Here


        ConcurrentMap<Object, PartialResult> map = sessionStore.get(groupID);

        Object feature = msg.getFeature();
        PartialResult partial = map.get(feature);
        if(partial == null) {
            final MixEventName event = msg.getEvent();
            switch(event) {
                case average:
                    partial = new PartialAverage(scale);
                    break;
                case argminKLD:
View Full Code Here

        }
        return partial;
    }

    private void mix(final ChannelHandlerContext ctx, final MixMessage requestMsg, final PartialResult partial) {
        MixEventName event = requestMsg.getEvent();
        Object feature = requestMsg.getFeature();
        float weight = requestMsg.getWeight();
        float covar = requestMsg.getCovariance();
        short clock = requestMsg.getClock();
        int deltaUpdates = requestMsg.getDeltaUpdates();
View Full Code Here

    @Override
    protected void encode(ChannelHandlerContext ctx, MixMessage msg, ByteBuf out) throws Exception {
        int startIdx = out.writerIndex();
        out.writeBytes(LENGTH_PLACEHOLDER);

        MixEventName event = msg.getEvent();
        byte b = event.getID();
        out.writeByte(b);

        Object feature = msg.getFeature();
        encodeObject(feature, out);
View Full Code Here

        assert (model != null);
        String jobId = (mixSessionName == null) ? MixClient.DUMMY_JOB_ID : mixSessionName;
        if(label != null) {
            jobId = jobId + '-' + label;
        }
        MixEventName event = useCovariance() ? MixEventName.argminKLD : MixEventName.average;
        MixClient client = new MixClient(event, jobId, connectURIs, ssl, mixThreshold, model);
        logger.info("Successfully configured mix client: " + connectURIs);
        return client;
    }
View Full Code Here

        if(frame == null) {
            return null;
        }

        byte b = frame.readByte();
        MixEventName event = MixEventName.resolve(b);
        Object feature = decodeObject(frame);
        float weight = frame.readFloat();
        float covariance = frame.readFloat();
        short clock = frame.readShort();
        int deltaUpdates = frame.readInt();
View Full Code Here

TOP

Related Classes of hivemall.mix.MixMessage.MixEventName

Copyright © 2018 www.massapicom. 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.