/** * @return the inner Counter associated with key o */ @Override public ClassicCounter<K2> getCounter(K1 o) { ClassicCounter<K2> c = map.get(o); if (c == null) { c = new ClassicCounter<>(innerMF); c.setDefaultReturnValue(defaultValue); map.put(o, c); } return c; }
/** * Constructs a new Counter with the contents of the given Counter. * <i>Implementation note:</i> A new Counter is allocated with its * own counts, but keys will be shared and should be an immutable class. * * @param c The Counter which will be copied. */ public ClassicCounter(Counter<E> c) { this(); Counters.addInPlace(this, c); setDefaultReturnValue(c.defaultReturnValue()); }
public ClassicCounter<Pair<K1, K2>> flatten() { ClassicCounter<Pair<K1, K2>> result = new ClassicCounter<>(); result.setDefaultReturnValue(defaultValue); for (K1 key1 : firstKeySet()) { ClassicCounter<K2> inner = getCounter(key1); for (K2 key2 : inner.keySet()) { result.setCount(new Pair<>(key1, key2), inner.getCount(key2)); } } return result; }
public AvgPerceptronLearner(double lrate[]) { this.lrate = lrate; wts.setDefaultReturnValue(0.1); }
/** * @return the inner Counter associated with key o */ public ClassicCounter<K2> getCounter(K1 o) { ClassicCounter<K2> c = map.get(o); if (c == null) { c = new ClassicCounter<K2>(innerMF); c.setDefaultReturnValue(defaultValue); map.put(o, c); } return c; }
/** * @return the inner Counter associated with key o */ public ClassicCounter<K2> getCounter(K1 o) { ClassicCounter<K2> c = map.get(o); if (c == null) { c = new ClassicCounter<K2>(innerMF); c.setDefaultReturnValue(defaultValue); map.put(o, c); } return c; }
/** * @return the inner Counter associated with key o */ @Override public ClassicCounter<K2> getCounter(K1 o) { ClassicCounter<K2> c = map.get(o); if (c == null) { c = new ClassicCounter<>(innerMF); c.setDefaultReturnValue(defaultValue); map.put(o, c); } return c; }
/** * @return the inner Counter associated with key o */ @Override public ClassicCounter<K2> getCounter(K1 o) { ClassicCounter<K2> c = map.get(o); if (c == null) { c = new ClassicCounter<>(innerMF); c.setDefaultReturnValue(defaultValue); map.put(o, c); } return c; }
/** * Constructs a new Counter with the contents of the given Counter. * <i>Implementation note:</i> A new Counter is allocated with its * own counts, but keys will be shared and should be an immutable class. * * @param c The Counter which will be copied. */ public ClassicCounter(Counter<E> c) { this(); Counters.addInPlace(this, c); setDefaultReturnValue(c.defaultReturnValue()); }
/** * Constructs a new Counter with the contents of the given Counter. * <i>Implementation note:</i> A new Counter is allocated with its * own counts, but keys will be shared and should be an immutable class. * * @param c The Counter which will be copied. */ public ClassicCounter(Counter<E> c) { this(); Counters.addInPlace(this, c); setDefaultReturnValue(c.defaultReturnValue()); }
/** * Constructs a new Counter with the contents of the given Counter. * <i>Implementation note:</i> A new Counter is allocated with its * own counts, but keys will be shared and should be an immutable class. * * @param c The Counter which will be copied. */ public ClassicCounter(Counter<E> c) { this(); Counters.addInPlace(this, c); setDefaultReturnValue(c.defaultReturnValue()); }
/** * Constructs a new Counter with the contents of the given Counter. * <i>Implementation note:</i> A new Counter is allocated with its * own counts, but keys will be shared and should be an immutable class. * * @param c The Counter which will be copied. */ public ClassicCounter(Counter<E> c) { this(); Counters.addInPlace(this, c); setDefaultReturnValue(c.defaultReturnValue()); }
public ClassicCounter<Pair<K1, K2>> flatten() { ClassicCounter<Pair<K1, K2>> result = new ClassicCounter<>(); result.setDefaultReturnValue(defaultValue); for (K1 key1 : firstKeySet()) { ClassicCounter<K2> inner = getCounter(key1); for (K2 key2 : inner.keySet()) { result.setCount(new Pair<>(key1, key2), inner.getCount(key2)); } } return result; }
public ClassicCounter<Pair<K1, K2>> flatten() { ClassicCounter<Pair<K1, K2>> result = new ClassicCounter<>(); result.setDefaultReturnValue(defaultValue); for (K1 key1 : firstKeySet()) { ClassicCounter<K2> inner = getCounter(key1); for (K2 key2 : inner.keySet()) { result.setCount(new Pair<>(key1, key2), inner.getCount(key2)); } } return result; }
public ClassicCounter<Pair<K1, K2>> flatten() { ClassicCounter<Pair<K1, K2>> result = new ClassicCounter<Pair<K1, K2>>(); result.setDefaultReturnValue(defaultValue); for (K1 key1 : firstKeySet()) { ClassicCounter<K2> inner = getCounter(key1); for (K2 key2 : inner.keySet()) { result.setCount(new Pair<K1, K2>(key1, key2), inner.getCount(key2)); } } return result; }
public ClassicCounter<Pair<K1, K2>> flatten() { ClassicCounter<Pair<K1, K2>> result = new ClassicCounter<Pair<K1, K2>>(); result.setDefaultReturnValue(defaultValue); for (K1 key1 : firstKeySet()) { ClassicCounter<K2> inner = getCounter(key1); for (K2 key2 : inner.keySet()) { result.setCount(new Pair<K1, K2>(key1, key2), inner.getCount(key2)); } } return result; }