Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2018 18:15:31 +0000 (UTC)
From:      "Jason W. Bacon" <jwb@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r467501 - in head/science: . fsom fsom/files
Message-ID:  <201804161815.w3GIFVYq058656@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jwb
Date: Mon Apr 16 18:15:30 2018
New Revision: 467501
URL: https://svnweb.freebsd.org/changeset/ports/467501

Log:
  fsom: Tiny C library for managing SOM (Self-Organizing Maps) neural networks
  
  Approved by:    jrm (mentor)
  Differential Revision:  https://reviews.freebsd.org/D15103

Added:
  head/science/fsom/
  head/science/fsom/Makefile   (contents, props changed)
  head/science/fsom/distinfo   (contents, props changed)
  head/science/fsom/files/
  head/science/fsom/files/Makefile   (contents, props changed)
  head/science/fsom/files/patch-fsom.c   (contents, props changed)
  head/science/fsom/pkg-descr   (contents, props changed)
Modified:
  head/science/Makefile

Modified: head/science/Makefile
==============================================================================
--- head/science/Makefile	Mon Apr 16 18:14:54 2018	(r467500)
+++ head/science/Makefile	Mon Apr 16 18:15:30 2018	(r467501)
@@ -53,6 +53,7 @@
     SUBDIR += fastcap
     SUBDIR += fasthenry
     SUBDIR += fisicalab
+    SUBDIR += fsom
     SUBDIR += fvcom
     SUBDIR += fvcom-mpi
     SUBDIR += fvm

Added: head/science/fsom/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/fsom/Makefile	Mon Apr 16 18:15:30 2018	(r467501)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME=	fsom
+DISTVERSION=	g20151117
+CATEGORIES=	science
+
+MAINTAINER=	jwb@FreeBSD.org
+COMMENT=	Tiny C library for managing SOM (Self-Organizing Maps) neural networks
+
+LICENSE=	GPLv3
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	ekg
+GH_TAGNAME=	56695e1611d824cda97f08e932d25d08419170cd
+
+INSTALL_TARGET=	install-strip
+
+PLIST_FILES=	bin/fsom \
+		include/fsom/convert.h \
+		include/fsom/fsom.h \
+		include/fsom/split.h \
+		lib/libfsom.a
+
+MAKEFILE=	${FILESDIR}/Makefile
+
+.include <bsd.port.mk>

Added: head/science/fsom/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/fsom/distinfo	Mon Apr 16 18:15:30 2018	(r467501)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1523601004
+SHA256 (ekg-fsom-g20151117-56695e1611d824cda97f08e932d25d08419170cd_GH0.tar.gz) = 1ba3360985be781bb9f79d974705c86e7bb0719cb83638955e113b5dd83ec8dd
+SIZE (ekg-fsom-g20151117-56695e1611d824cda97f08e932d25d08419170cd_GH0.tar.gz) = 9771

Added: head/science/fsom/files/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/fsom/files/Makefile	Mon Apr 16 18:15:30 2018	(r467501)
@@ -0,0 +1,52 @@
+
+# Use ?= to allow overriding from the env or command-line, e.g.
+#
+#       make CXXFLAGS="-O3 -fPIC" install
+#
+# Package managers will override many of these variables automatically, so
+# this is aimed at making it easy to create packages (Debian packages,
+# FreeBSD ports, MacPorts, pkgsrc, etc.)
+
+CXX ?=		g++
+CXXFLAGS ?=	-w -O3 -pipe -fomit-frame-pointer -ffast-math
+AR ?=		ar
+MKDIR ?=	mkdir
+STRIP ?=	strip
+DESTDIR ?=	stage
+PREFIX ?=	/usr/local
+
+BIN =	fsom
+LIB =	libfsom.a
+OBJS =	fsom.o split.o
+MAIN =	main.o
+
+all:	${BIN} ${LIB}
+
+${BIN}:	${OBJS} ${MAIN}
+	${CXX} -o fsom ${OBJS} ${MAIN} -lm
+
+${LIB}:	${OBJS}
+	${AR} -rs ${LIB} ${OBJS}
+
+fsom.o:	fsom.c
+	${CXX} ${CXXFLAGS} -c fsom.c
+
+split.o: split.cpp
+	${CXX} ${CXXFLAGS} -c split.cpp
+
+main.o: main.cpp
+	${CXX} ${CXXFLAGS} -c main.cpp
+
+install: all
+	${MKDIR} -p ${DESTDIR}${PREFIX}/bin
+	${MKDIR} -p ${DESTDIR}${PREFIX}/include/fsom
+	${MKDIR} -p ${DESTDIR}${PREFIX}/lib
+	${INSTALL} ${BIN} ${DESTDIR}${PREFIX}/bin
+	${INSTALL} *.h ${DESTDIR}${PREFIX}/include/fsom
+	${INSTALL} ${LIB} ${DESTDIR}${PREFIX}/lib
+
+install-strip: install
+	${STRIP} ${DESTDIR}${PREFIX}/bin/${BIN}
+
+clean:
+	rm -rf *.o ${BIN} ${LIB} ${DESTDIR}

Added: head/science/fsom/files/patch-fsom.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/fsom/files/patch-fsom.c	Mon Apr 16 18:15:30 2018	(r467501)
@@ -0,0 +1,26 @@
+--- fsom.c.orig	2015-11-21 16:35:06 UTC
++++ fsom.c
+@@ -31,6 +31,10 @@
+ #define 	M_E		2.7182818284590452354
+ #endif
+ 
++#ifndef		ABS
++#define		ABS(x)		((x) < 0 ? -(x) : (x))
++#endif
++
+ /**
+  * \brief  Create a new synapsis between two neurons
+  * \param  input_neuron 		Input neuron for the synapsis
+@@ -591,10 +595,10 @@ som_train_iteration ( som_network_t *net
+ 	som_neuron_t *neuron;
+ 	for ( i=0; i < net->output_layer->neurons_rows; ++i )
+ 	{
+-		dist_i = abs( x - i );
++		dist_i = ABS( x - i );
+ 		for ( j=0; j < net->output_layer->neurons_cols; ++j )
+ 		{
+-			dist     = pow( dist_i + abs ( y - j ), 4 );
++			dist     = pow( dist_i + ABS ( y - j ), 4 );
+ 			inv_dist = (1.0 / ((double) dist + 1)) * l_rate;
+ 			neuron   = net->output_layer->neurons[i][j];
+ 			for ( k=0; k < net->input_layer->neurons_count; ++k )

Added: head/science/fsom/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/fsom/pkg-descr	Mon Apr 16 18:15:30 2018	(r467501)
@@ -0,0 +1,6 @@
+FSOM is a tiny C library for managing SOM (Self-Organizing Maps) neural
+networks, a type of artificial neural network (ANN) that is trained using
+unsupervised learning to produce a low-dimensional (typically two-dimensional),
+discretized representation of the input space of the training samples.
+
+WWW: https://github.com/ekg/fsom



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804161815.w3GIFVYq058656>