/*******************************************************************************
 * DIANNE  - Framework for distributed artificial neural networks
 * Copyright (C) 2015  iMinds - IBCN - UGent
 *
 * This file is part of DIANNE.
 *
 * DIANNE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Contributors:
 *     Tim Verbelen, Steven Bohez
 *******************************************************************************/
package be.iminds.iot.dianne.api.coordinator;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import be.iminds.iot.dianne.api.nn.eval.Evaluation;
import be.iminds.iot.dianne.api.nn.learn.LearnProgress;

/**
 * Summarizes the learn results
 * @author tverbele
 *
 */
public class LearnResult {

	public Map<UUID, List<LearnProgress>> progress = new HashMap<>();
	public Map<Long, Evaluation> validations = new HashMap<>();
	
	public LearnResult(){}
	
	public LearnResult(Map<UUID, List<LearnProgress>> p, Map<Long, Evaluation> v){
		this.progress = p;
		this.validations = v;
	}
	
	public long getIterations(){
		return progress.values().iterator().next().get(progress.size()-1).iteration;
	}
	
	public float getError(){
		return progress.values().iterator().next().get(progress.size()-1).miniBatchError;
	}
}

@@ -1676,30 +1676,47 @@
 ations()%7B%0A%09%09
-return
+List%3CLearnProgress%3E p =
  progress.va
@@ -1735,37 +1735,42 @@
 tor().next()
-.get(progress
+;%0A%09%09return p.get(p
 .size()-1).i
@@ -1812,22 +1812,39 @@
 or()%7B%0A%09%09
-return
+List%3CLearnProgress%3E p =
  progres
@@ -1875,21 +1875,26 @@
 xt()
-.get(progress
+;%0A%09%09return p.get(p
 .siz

fix reported iterations/error in LearnResult