Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D52617B1C for ; Sun, 19 Jul 2015 21:27:18 +0000 (UTC) Received: (qmail 37766 invoked by uid 500); 19 Jul 2015 21:27:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 37693 invoked by uid 500); 19 Jul 2015 21:27:18 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 37684 invoked by uid 99); 19 Jul 2015 21:27:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jul 2015 21:27:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E94CBDFFA2; Sun, 19 Jul 2015 21:27:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: erans@apache.org To: commits@commons.apache.org Message-Id: <545e691826984670b1d90a9a26c7e38f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [math] MATH-1251 Date: Sun, 19 Jul 2015 21:27:17 +0000 (UTC) Repository: commons-math Updated Branches: refs/heads/master af199c675 -> 9c545d44a MATH-1251 Fixed initial value of the "number of calls" counter. Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/9c545d44 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/9c545d44 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/9c545d44 Branch: refs/heads/master Commit: 9c545d44a4a703c88d417a6fa43298a80ee67735 Parents: af199c6 Author: Gilles Authored: Sun Jul 19 23:26:48 2015 +0200 Committer: Gilles Committed: Sun Jul 19 23:26:48 2015 +0200 ---------------------------------------------------------------------- src/changes/changes.xml | 4 ++++ .../commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/9c545d44/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2ba9b8c..01483dc 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -54,6 +54,10 @@ If the output is not quite correct, check for invisible trailing spaces! + + Fixed initial value of "number of calls" counter in class "KohonenUpdateAction" + (package "o.a.c.m.ml.neuralnet.sofm"). + "Neuron" class (package "o.a.c.m.ml.neuralnet"): added methods that can be used to assess concurrency performance. http://git-wip-us.apache.org/repos/asf/commons-math/blob/9c545d44/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java index b937291..1b4b54e 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java @@ -74,7 +74,7 @@ public class KohonenUpdateAction implements UpdateAction { /** Neighbourhood size update function. */ private final NeighbourhoodSizeFunction neighbourhoodSize; /** Number of calls to {@link #update(Network,double[])}. */ - private final AtomicLong numberOfCalls = new AtomicLong(-1); + private final AtomicLong numberOfCalls = new AtomicLong(0); /** * @param distance Distance function. @@ -95,7 +95,7 @@ public class KohonenUpdateAction implements UpdateAction { @Override public void update(Network net, double[] features) { - final long numCalls = numberOfCalls.incrementAndGet(); + final long numCalls = numberOfCalls.incrementAndGet() - 1; final double currentLearning = learningFactor.value(numCalls); final Neuron best = findAndUpdateBestNeuron(net, features,