Package java.io

Examples of java.io.DataOutputStream.writeFloat()


            } else if (type == Long.TYPE) {
                for (int i = 0; i < delegate.getSize(); i++)
                    dos.writeLong(Array.getLong(data, i));
            } else if (type == Float.TYPE) {
                for (int i = 0; i < delegate.getSize(); i++)
                    dos.writeFloat(Array.getFloat(data, i));
            } else if (type == Double.TYPE) {
                for (int i = 0; i < delegate.getSize(); i++)
                    dos.writeDouble(Array.getDouble(data, i));
            }
        }
View Full Code Here


                for (int k=0; k<alen; k++)
                  dos.writeLong(((long[])obj)[k+offset]);
                break;
              case TFormat.CF_FLOAT:
                for (int k=0; k<alen; k++)
                  dos.writeFloat(((float[])obj)[k+offset]);
                break;
              case TFormat.CF_DOUBLE:
                for (int k=0; k<alen; k++)
                  dos.writeDouble(((double[])obj)[k+offset]);
                break;
View Full Code Here

            double[] syn0 = null;
            for (Entry<String, Neuron> element : wordMap.entrySet()) {
                dataOutputStream.writeUTF(element.getKey());
                syn0 = ((WordNeuron) element.getValue()).syn0;
                for (double d : syn0) {
                    dataOutputStream.writeFloat(((Double) d).floatValue());
                }
            }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

                for(int i = 0; i < delegate.getSize(); i++)
                    dos.writeLong(Array.getLong(data, i));
                break;
            case 'f':
                for(int i = 0; i < delegate.getSize(); i++)
                    dos.writeFloat(Array.getFloat(data, i));
                break;
            case 'd':
                for(int i = 0; i < delegate.getSize(); i++)
                    dos.writeDouble(Array.getDouble(data, i));
                break;
View Full Code Here

    ByteArrayOutputStream byteOut = new ByteArrayOutputStream(4);
    DataOutputStream dataOut = new DataOutputStream(byteOut);
    byte bytes[] = new byte[4];
   
    try {
      dataOut.writeFloat(value);
      dataOut.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
    bytes = byteOut.toByteArray();
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream datas = null;
       
        try {
            datas = new DataOutputStream(out);
            datas.writeFloat(f);
        } finally {
            if ( datas != null ) datas.close();
        }
       
        try {
View Full Code Here

        dos.writeLong(l);
        break;

      case FLOAT:
        float f = ((FloatObjectInspector) oi).get(o);
        dos.writeFloat(f);
        break;

      case DOUBLE:
        double d = ((DoubleObjectInspector) oi).get(o);
        dos.writeDouble(d);
View Full Code Here

   
    d.writeInt(this.IterationComplete);
    d.writeInt(this.CurrentIteration);
   
    d.writeInt(this.TrainedRecords);
    d.writeFloat(this.AvgLogLikelihood);
    d.writeFloat(this.PercentCorrect);
    // buf.write
    // MatrixWritable.writeMatrix(d, this.worker_gradient.getMatrix());
    MatrixWritable.writeMatrix(d, this.parameter_vector);
    // MatrixWritable.
View Full Code Here

    d.writeInt(this.IterationComplete);
    d.writeInt(this.CurrentIteration);
   
    d.writeInt(this.TrainedRecords);
    d.writeFloat(this.AvgLogLikelihood);
    d.writeFloat(this.PercentCorrect);
    // buf.write
    // MatrixWritable.writeMatrix(d, this.worker_gradient.getMatrix());
    MatrixWritable.writeMatrix(d, this.parameter_vector);
    // MatrixWritable.
   
View Full Code Here

     
      d.writeInt(this.IterationComplete);
      d.writeInt(this.CurrentIteration);
      d.writeLong(this.batchTimeMS);
      d.writeInt(this.TrainedRecords);
      d.writeFloat(this.AvgError);
      MatrixWritable.writeMatrix(d, this.parameter_vector);
     
      return out.toByteArray();
    }
   
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.