Posted by Anonymous on Fri 3rd Sep 20:01 (modification of post by view diff)
download | new post
- public static void writeParametersBinary(Configuration conf, String name, Map<Integer, double[]> params, Path outputDir) throws IOException
- {
- FileSystem fs = FileSystem.get(conf);
- Path file = new Path(outputDir, name);
- if (fs.exists(file))
- {
- fs.delete(file, true);
- }
- FSDataOutputStream writer = fs.create(file);
- writer.writeLong(params.size());
- {
- writer.writeInt(entry.getKey());
- for (double factor : entry.getValue())
- {
- writer.writeDouble(factor);
- }
- }
- writer.sync();
- writer.flush();
- writer.close();
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.