-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Description
private void readVocab(File file) throws IOException {
MapCount<String> mc = new MapCount<>();
try (BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(file)))) {
String temp = null;
while ((temp = br.readLine()) != null) {
String[] split = temp.split(" ");
trainWordsCount += split.length;
for (String string : split) {
mc.add(string);
}
}
}
for (Entry<String, Integer> element : mc.get().entrySet()) {
wordMap.put(element.getKey(), new WordNeuron(element.getKey(),
(double) element.getValue() / mc.size(), layerSize));
}
}
其中的MapCount的size是否不应该用HashMap的size,而是应该用HashMap中所有value之和?
Metadata
Metadata
Assignees
Labels
No labels