| 66 | } |
| 67 | |
| 68 | public static final class JobStateDescr implements Writable { |
| 69 | public SigmoidLossMultinomial underlying = null; |
| 70 | public WritableVariableList defs = null; |
| 71 | public boolean useIntercept = true; |
| 72 | public String weightKey = null; |
| 73 | public double[] x = null; |
| 74 | public boolean wantGrad = false; |
| 75 | public boolean wantHessian = false; |
| 76 | |
| 77 | @Override |
| 78 | public void readFields(final DataInput in) throws IOException { |
| 79 | underlying = null; |
| 80 | defs = null; |
| 81 | x = null; |
| 82 | wantGrad = false; |
| 83 | wantHessian = false; |
| 84 | try { |
| 85 | underlying = (SigmoidLossMultinomial)SerialUtils.readSerialiazlabeFromString(in.readUTF()); |
| 86 | } catch (ClassNotFoundException e) { |
| 87 | throw new IOException(e.toString()); |
| 88 | } |
| 89 | defs = new WritableVariableList(); |
| 90 | defs.readFields(in); |
| 91 | useIntercept = in.readBoolean(); |
| 92 | final boolean haveWeightKey = in.readBoolean(); |
| 93 | if(haveWeightKey) { |
| 94 | weightKey = in.readUTF(); |
| 95 | } else { |
| 96 | weightKey = null; |
| 97 | } |
| 98 | x = WritableUtils.readVec(in); |
| 99 | wantGrad = in.readBoolean(); |
| 100 | wantHessian = in.readBoolean(); |
| 101 | |
| 102 | } |
| 103 | |
| 104 | @Override |
| 105 | public void write(final DataOutput out) throws IOException { |
| 106 | out.writeUTF(SerialUtils.serializableToString(underlying)); |
| 107 | defs.write(out); |
| 108 | out.writeBoolean(useIntercept); |
| 109 | out.writeBoolean(null!=weightKey); |
| 110 | if(null!=weightKey) { |
| 111 | out.writeUTF(weightKey); |
| 112 | } |
| 113 | WritableUtils.writeVec(x,out); |
| 114 | out.writeBoolean(wantGrad); |
| 115 | out.writeBoolean(wantHessian); |
| 116 | } |
| 117 | |
| 118 | @Override |
| 119 | public String toString() { |
| 120 | try { |
| 121 | return WritableUtils.writableToString(this); |
| 122 | } catch (Exception ex) { |
| 123 | throw new RuntimeException(ex); |
| 124 | } |
| 125 | } |
nothing calls this directly
no outgoing calls
no test coverage detected