本文整理了Java中water.Key.rand()
方法的一些代码示例,展示了Key.rand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.rand()
方法的具体详情如下:
包路径:water.Key
类名称:Key
方法名:rand
暂无
代码示例来源:origin: h2oai/h2o-3
private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model) {
String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name;
return directSVD(dinfo, qfrm, model, u_name);
}
private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model, String u_name) {
代码示例来源:origin: h2oai/h2o-3
public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) {
return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand());
}
代码示例来源:origin: h2oai/h2o-2
protected Key defaultDestKey() {
return Key.make(getClass().getSimpleName() + Key.rand());
}
代码示例来源:origin: h2oai/h2o-2
private Key defaultTreeKey() {
return Key.makeSystem("__Tree_"+Key.rand());
}
代码示例来源:origin: h2oai/h2o-2
static public Key make(byte rf, byte systemType, H2ONode... replicas) {
return make(rand(),rf,systemType,replicas);
}
代码示例来源:origin: h2oai/h2o-2
static public Key make() { return make(rand()); }
代码示例来源:origin: h2oai/h2o-2
String uid = Key.rand();
ClassMap renames = new ClassMap();
for( JarEntry entry : entries ) {
代码示例来源:origin: h2oai/h2o-2
public T invokeOnAllNodes() {
H2O cloud = H2O.CLOUD;
Key[] args = new Key[cloud.size()];
String skey = "RunOnAll"+Key.rand();
for( int i = 0; i < args.length; ++i )
args[i] = Key.make(skey,(byte)0,Key.DFJ_INTERNAL_USER,cloud._memary[i]);
invoke(args);
for( Key arg : args ) DKV.remove(arg);
return self();
}
代码示例来源:origin: h2oai/h2o-2
/**
* Rebalance a frame for load balancing
* @param fr Input frame
* @param local whether to only create enough chunks to max out all cores on one node only
* @return Frame that has potentially more chunks
*/
private Frame reBalance(final Frame fr, boolean local) {
int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows());
if (fr.anyVec().nChunks() > chunks && !reproducible) {
Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance.");
return fr;
} else if (reproducible) {
Log.warn("Reproducibility enforced - using only 1 thread - can be slow.");
chunks = 1;
}
if (!quiet_mode) Log.info("ReBalancing dataset into (at least) " + chunks + " chunks.");
// return MRUtils.shuffleAndBalance(fr, chunks, seed, local, shuffle_training_data);
String snewKey = fr._key != null ? (fr._key.toString() + ".balanced") : Key.rand();
Key newKey = Key.makeSystem(snewKey);
RebalanceDataSet rb = new RebalanceDataSet(fr, newKey, chunks);
H2O.submitTask(rb);
rb.join();
return UKV.get(newKey);
}
代码示例来源:origin: h2oai/h2o-3
String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name;
String v_name = (_parms._v_name == null || _parms._v_name.length() == 0) ? "SVDVMatrix_" + Key.rand() : _parms._v_name;
代码示例来源:origin: h2oai/h2o-2
DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs);
if(userKeys[i].home())++homeKeys;
systemKeys[i] = Key.makeSystem(Key.rand());
DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedInt(i)),fs);
DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedDouble(i),fs);
if(userKeys[i].home())++homeKeys;
systemKeys[i] = Key.makeSystem(Key.rand());
DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedDouble(i)),fs);
代码示例来源:origin: h2oai/h2o-3
Key<Grid> gridKey = Key.make("GLRM_grid_iris" + Key.rand());
代码示例来源:origin: h2oai/h2o-2
try {
for (int i = 0; i < 1e2; ++i) {
Key k = Key.makeSystem(Key.rand());
keys.add(k);
DKV.put(k, new Value(k, new Utils.IcedInt(i)));
代码示例来源:origin: h2oai/h2o-3
Key<Grid> gridKey = Key.make("GLRM_grid_iris" + Key.rand());
for (int i = 0; i < ITER_CNT; i++) {
Job<Grid> gs = GridSearch.startGridSearch(gridKey, params, hyperParms);
代码示例来源:origin: h2oai/h2o-2
@Test
public void testLocalKeySet(){
Key [] userKeys = new Key[100];
Key [] systemKeys = new Key[100];
int homeKeys = 0;
Futures fs = new Futures();
try {
for( int i = 0; i < userKeys.length; ++i ) {
DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs,true);
if( userKeys[i].home() ) ++homeKeys;
DKV.put(systemKeys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true);
}
fs.blockForPending();
Key[] keys = H2O.KeySnapshot.localSnapshot().keys();
Assert.assertEquals(homeKeys, keys.length);
for (Key k:keys)
Assert.assertTrue(k.home());
} finally {
for (int i = 0; i < userKeys.length; ++i) {
DKV.remove(userKeys[i],fs);
DKV.remove(systemKeys[i],fs);
}
fs.blockForPending();
}
}
代码示例来源:origin: h2oai/h2o-2
@Test
public void testGlobalKeySet(){
Key keys[] = new Key[100];
Futures fs = new Futures();
try {
for (int i = 0; i < 100; ++i)
DKV.put(Key.make("key" + i), new Utils.IcedInt(i),fs,true);
for( int i = 0; i < 100; ++i)
DKV.put(keys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true);
fs.blockForPending();
Key[] keys2 = H2O.KeySnapshot.globalSnapshot().keys();
Assert.assertEquals(100, keys2.length);
} finally {
for (int i = 0; i < 100; ++i) {
DKV.remove(Key.make("key" + i),fs);
DKV.remove(keys[i],fs);
}
fs.blockForPending();
}
}
代码示例来源:origin: h2oai/h2o-3
"GLRMLoading_" + Key.rand() : _parms._representation_name;
model._output._representation_key = Key.make(model._output._representation_name);
代码示例来源:origin: ai.h2o/h2o-algos
private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model) {
String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name;
return directSVD(dinfo, qfrm, model, u_name);
}
private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model, String u_name) {
代码示例来源:origin: ai.h2o/h2o-algos
public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) {
return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand());
}
代码示例来源:origin: ai.h2o/h2o-algos
String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name;
String v_name = (_parms._v_name == null || _parms._v_name.length() == 0) ? "SVDVMatrix_" + Key.rand() : _parms._v_name;
内容来源于网络,如有侵权,请联系作者删除!