Commit 588c5695 authored by ale's avatar ale

embed torch3 library with output-to-stderr patch

parent 07ca7aa8
SUBDIRS = immscore analyzer model
SUBDIRS = ext immscore analyzer model
include $(top_srcdir)/vars.mk
noinst_LIBRARIES = libimmsanalyzer.a
bin_PROGRAMS = imms-analyzer
imms_analyzer_SOURCES = \
analyzer.cc \
analyzer.h \
libimmsanalyzer_a_SOURCES = \
beatkeeper.cc \
beatkeeper.h \
fftprovider.cc \
......@@ -15,4 +14,9 @@ imms_analyzer_SOURCES = \
mfcckeeper.cc \
mfcckeeper.h
imms_analyzer_LDADD = ../immscore/libimmscore.a
imms_analyzer_SOURCES = \
analyzer.cc \
analyzer.h
imms_analyzer_LDADD = $(ANALYZER_LIB) $(IMMSCORE_LIB) $(TORCH_LIB)
......@@ -122,29 +122,6 @@ if test "$enable_analyzer" != "no"; then
CFLAGS="$CFLAGS $FFTW_CFLAGS"
fi
if test "$enable_analyzer" != "no"; then
AC_CHECK_HEADERS(torch/KMeans.h,, [have_torch=no])
saved_libs="$LIBS"
LIBS="$LIBS -ltorch"
AC_MSG_CHECKING([libtorch usability])
AC_TRY_LINK([#include <torch/KMeans.h> ],
[Torch::KMeans kmeans(10, 5)],
[AC_MSG_RESULT(yes)],
[have_torch=no; AC_MSG_RESULT(no)])
if test "$have_torch" = "no"; then
AC_MSG_WARN([******************************************************]);
AC_MSG_WARN("torch >= 3.0 required for analyzer and missing");
AC_MSG_WARN("Acoustic analysis engine will not be built");
AC_MSG_WARN([******************************************************]);
enable_analyzer=no
LIBS=$saved_libs
else
AC_DEFINE(WITH_TORCH,, [libtorch support])
fi
fi
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0],
[], [AC_MSG_ERROR([Required packages missing.])])
......@@ -246,6 +223,8 @@ AC_CONFIG_HEADERS(immsconf.h)
AC_OUTPUT(
vars.mk
Makefile
ext/Makefile
ext/torch3/Makefile
immscore/Makefile
analyzer/Makefile
model/Makefile
......
SUBDIRS = torch3
===============================================================================
Torch 3.1
===============================================================================
core
====
* Bagging.cc
- Initialize "is_selected_examples" to NULL.
* ClassFormatDataSet.cc
- Convert all the frames of targets, and not only the
first one.
* ClassMeasurer.cc
- Scan all the frames of inputs to compute classification
error, and not only the first one.
- The confusion matrix computation option at the end of
the training as been removed. The confusion matrix is still
available at each iteration.
* CmdOption.cc
- When calling loadXFile(), a string not always allocated
was freed.
* DiskDataSet.cc
- The number of examples was computed using io_inputs, even
if it was NULL.
* KFold.cc
- The size of the folds is more balanced for small folds.
* MemoryDataSet.cc
- The number of examples was computed using io_inputs, even
if it was NULL.
* MemoryXFile.cc
- The EOF flag was not updated when reaching the end of file
while reading with the scanf method.
* MultiClassFormat.cc
- Serious bug when auto-detecting classes corrected.
* Random.cc
- Using now memmove instead of memcopy (possibility of
overlapping source and destination).
matrix
======
* Mat.cc and Mat.h
- Initializing a matrix from a "real *" now possible.
gradients
=========
* SumMachine.cc
- The gradient is now well back-propagated.
kernels
=======
* QCTrainer.cc
- Bug when updating alpha corrected. Note: very rare
case in practice. Thanks to Stephen Schiller for the
report of this tricky bug.
distributions
=============
* DiagonalGMM.cc
- log_probabilities are now correctely computed for the viterbi case
- frameExpectation becomes frameDecision
- keep the best gaussian for the current frame
* Distribution.cc
- resize the output of the machine correctely
- added decision and frameDecision method
* HMM.cc
- added states shared parameters
* MAPDiagonalGMM.cc
- adapt the parameters only if the gaussian have "seen" at
least one frame
* Multinomial.cc
- added equal initialization option
- added check that the log weights are number
- frameExpectation becomes frameDecision
* NLLCriterion.cc
- correct the beta and outputs resize
* ParzenDistribution.cc
- correct the resize of the log_probablities
- added frameExpectation method
* TableLookupDistribution.cc
- correction of some bugs to calculate the log probablity
* ViterbiTrainer.cc ,ViterbiTrainer.h
- this class is suppressed, it was already included in EMTrainer
datasets
========
* IOHTK.cc
- correction of some major bugs when reading the HTK files on
disk on unsequential mode
- correction of major bug on double mode
* IOHTKTarget.cc
- space followed by tabulation allowed instead of space only
- added some check
* IOHTKTarget.h
- make saveSequence static
* Vocabulary.cc
- bound check corrected for the number of words
speech
======
* EditDistance.{cc,h} and EditDistanceMeasurer.{cc,h}
- Add a constructor option to print a confusion matrix as well
* WordSeg.{cc,h} and FrameSeg.{cc,h}
- Two new class to keep the word and frame segmentations found
by viterbi decoding. These are kept separate so as to be
compatible with any new subclass of SpeechHMM.
* WordSegMeasurer.{cc,h} and FrameSegMeasurer.{cc,h}
- Measurers that outputs information related to the number
of errors in terms of word error rate (WordSegMeasurer) or
frame error rate (FrameSegMeasurer), using the EditDistance
class to compute the error.
* SimpleDecoderSpeechHMM.{cc,h}
- Modifications to take into account the new WordSeg and FrameSeg
classes
- added a structure (previous_states[] and n_previous_states)
to speedup the decoding process by only looping on existing
transitions and not all possible transitions
- Added an option to be able to decode using "forced alignment",
hence instead of decoding on the whole grammar, decoding on
a given (true) sentence
* SpeechHMM.cc
- bug corrections related to initialization
Copyright (c) 2003--2004 Ronan Collobert
Copyright (c) 2003--2004 Samy Bengio
Copyright (c) 2003--2004 Johnny Mariéthoz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(top_srcdir)/vars.mk
AM_CXXFLAGS += -ffast-math -malign-double
PACKAGES = core distributions gradients matrix kernels
nobase_noinst_LIBRARIES = libtorch.a
libtorch_a_SOURCES = \
core/Allocator.cc \
core/Bagging.cc \
core/Boosting.cc \
core/BoostingMeasurer.cc \
core/ClassFormat.cc \
core/ClassFormatDataSet.cc \
core/ClassMeasurer.cc \
core/ClassNLLMeasurer.cc \
core/CmdLine.cc \
core/CmdOption.cc \
core/DataSet.cc \
core/DiskDataSet.cc \
core/DiskMatDataSet.cc \
core/DiskXFile.cc \
core/FileListCmdOption.cc \
core/FrameSelectorDataSet.cc \
core/IOAscii.cc \
core/IOBin.cc \
core/IOBufferize.cc \
core/IOMulti.cc \
core/IOSequence.cc \
core/IOSequenceArray.cc \
core/IOSub.cc \
core/KFold.cc \
core/MSEMeasurer.cc \
core/Machine.cc \
core/MatDataSet.cc \
core/MeanVarNorm.cc \
core/Measurer.cc \
core/MemoryDataSet.cc \
core/MemoryXFile.cc \
core/MultiClassFormat.cc \
core/NullXFile.cc \
core/Object.cc \
core/OneHotClassFormat.cc \
core/OutputMeasurer.cc \
core/Parameters.cc \
core/PipeXFile.cc \
core/PreProcessing.cc \
core/Random.cc \
core/Sequence.cc \
core/Stack.cc \
core/TimeMeasurer.cc \
core/Timer.cc \
core/Trainer.cc \
core/TwoClassFormat.cc \
core/WeightedSumMachine.cc \
core/XFile.cc \
core/general.cc \
core/log_add.cc \
core/string_utils.cc \
core/Allocator.h \
core/Bagging.h \
core/Boosting.h \
core/BoostingMeasurer.h \
core/ClassFormat.h \
core/ClassFormatDataSet.h \
core/ClassMeasurer.h \
core/ClassNLLMeasurer.h \
core/CmdLine.h \
core/CmdOption.h \
core/DataSet.h \
core/DiskDataSet.h \
core/DiskMatDataSet.h \
core/DiskXFile.h \
core/FileListCmdOption.h \
core/FrameSelectorDataSet.h \
core/IOAscii.h \
core/IOBin.h \
core/IOBufferize.h \
core/IOMulti.h \
core/IOSequence.h \
core/IOSequenceArray.h \
core/IOSub.h \
core/KFold.h \
core/List.h \
core/MSEMeasurer.h \
core/Machine.h \
core/MatDataSet.h \
core/MeanVarNorm.h \
core/Measurer.h \
core/MemoryDataSet.h \
core/MemoryXFile.h \
core/MultiClassFormat.h \
core/NullXFile.h \
core/Object.h \
core/OneHotClassFormat.h \
core/OutputMeasurer.h \
core/Parameters.h \
core/PipeXFile.h \
core/PreProcessing.h \
core/Random.h \
core/Sequence.h \
core/Stack.h \
core/TimeMeasurer.h \
core/Timer.h \
core/Trainer.h \
core/TwoClassFormat.h \
core/WeightedSumMachine.h \
core/XFile.h \
core/general.h \
core/log_add.h \
core/string_utils.h \
distributions/BayesClassifier.cc \
distributions/BayesClassifierMachine.cc \
distributions/DiagonalGMM.cc \
distributions/Distribution.cc \
distributions/EMTrainer.cc \
distributions/HMM.cc \
distributions/KMeans.cc \
distributions/LogRBF.cc \
distributions/MAPDiagonalGMM.cc \
distributions/MAPHMM.cc \
distributions/Multinomial.cc \
distributions/NLLCriterion.cc \
distributions/NLLMeasurer.cc \
distributions/ParzenDistribution.cc \
distributions/TableLookupDistribution.cc \
distributions/BayesClassifier.h \
distributions/BayesClassifierMachine.h \
distributions/DiagonalGMM.h \
distributions/Distribution.h \
distributions/EMTrainer.h \
distributions/HMM.h \
distributions/KMeans.h \
distributions/LogRBF.h \
distributions/MAPDiagonalGMM.h \
distributions/MAPHMM.h \
distributions/Multinomial.h \
distributions/NLLCriterion.h \
distributions/NLLMeasurer.h \
distributions/ParzenDistribution.h \
distributions/TableLookupDistribution.h \
matrix/Mat.cc \
matrix/Mat_operations.cc \
matrix/Perm.cc \
matrix/Perm_operations.cc \
matrix/Vec.cc \
matrix/mx_givens.cc \
matrix/mx_hessenberg.cc \
matrix/mx_householder.cc \
matrix/mx_low_level.cc \
matrix/mx_lu_factor.cc \
matrix/mx_solve.cc \
matrix/mx_sym_eig.cc \
matrix/Mat.h \
matrix/Mat_operations.h \
matrix/Perm.h \
matrix/Perm_operations.h \
matrix/Vec.h \
matrix/matrix.h \
matrix/mx_givens.h \
matrix/mx_hessenberg.h \
matrix/mx_householder.h \
matrix/mx_low_level.h \
matrix/mx_lu_factor.h \
matrix/mx_solve.h \
matrix/mx_sym_eig.h \
kernels/Kernel.cc \
kernels/QCCache.cc \
kernels/QCMachine.cc \
kernels/QCTrainer.cc \
kernels/SVM.cc \
kernels/SVMCache.cc \
kernels/SVMClassification.cc \
kernels/SVMRegression.cc \
kernels/Kernel.h \
kernels/QCCache.h \
kernels/QCMachine.h \
kernels/QCTrainer.h \
kernels/SVM.h \
kernels/SVMCache.h \
kernels/SVMClassification.h \
kernels/SVMRegression.h \
gradients/ClassNLLCriterion.cc \
gradients/ConnectedMachine.cc \
gradients/Criterion.cc \
gradients/Exp.cc \
gradients/GradientMachine.cc \
gradients/InputsSelect.cc \
gradients/Linear.cc \
gradients/LogMixer.cc \
gradients/LogSigmoid.cc \
gradients/LogSoftMax.cc \
gradients/MLP.cc \
gradients/MSECriterion.cc \
gradients/Mixer.cc \
gradients/MultiCriterion.cc \
gradients/SaturationMeasurer.cc \
gradients/Sigmoid.cc \
gradients/SoftMax.cc \
gradients/SoftPlus.cc \
gradients/StochasticGradient.cc \
gradients/SumMachine.cc \
gradients/Tanh.cc \
gradients/WeightedMSECriterion.cc \
gradients/ClassNLLCriterion.h \
gradients/ConnectedMachine.h \
gradients/Criterion.h \
gradients/Exp.h \
gradients/GradientMachine.h \
gradients/InputsSelect.h \
gradients/Linear.h \
gradients/LogMixer.h \
gradients/LogSigmoid.h \
gradients/LogSoftMax.h \
gradients/MLP.h \
gradients/MSECriterion.h \
gradients/Mixer.h \
gradients/MultiCriterion.h \
gradients/SaturationMeasurer.h \
gradients/Sigmoid.h \
gradients/SoftMax.h \
gradients/SoftPlus.h \
gradients/StochasticGradient.h \
gradients/SumMachine.h \
gradients/Tanh.h \
gradients/WeightedMSECriterion.h
[torch]
# Need more verbosity ?
#verbose = 1
# Packages you want to use
packages =
# Magik key if you want several libraries
# for the same platform
#magic_key =
# Compiler, linker and archiver
compiler = CC
linker = CC
archiver = ar -rus
# Your librairies
# (for example "-lm", but not needed on most systems...)
libraries =
# Your includes
# (for example -I/usr/local/special)
includes =
# optimize mode
debug = opt
# debug mode
#debug = dbg
# double version
#floating = double
# float version
floating = float
# Debug double mode
dbg_double = -g -Wall -DUSE_DOUBLE -DDEBUG
# Debug float mode
dbg_float = -g -Wall -DDEBUG
# Optimized double mode
opt_double = -fast -xO5 -xarch=native -DUSE_DOUBLE
# Optimized float mode
opt_float = -fast -xO5 -xarch=native
[torch]
# Need more verbosity ?
#verbose = 1
# Packages you want to use
packages =
# Magik key if you want several libraries
# for the same platform
#magic_key =
# Compiler, linker and archiver
compiler = g++
linker = g++
archiver = ar -rus
# Your librairies
# (for example "-lm", but not needed on most systems...)
libraries =
# Your includes
# (for example -I/usr/local/special)
includes =
# optimize mode
debug = opt
# debug mode
#debug = dbg
# double version
#floating = double
# float version
floating = float
# Debug double mode
dbg_double = -g -Wall -DUSE_DOUBLE -DDEBUG
# Debug float mode
dbg_float = -g -Wall -DDEBUG
# Optimized double mode
opt_double = -Wall -O2 -ffast-math -DUSE_DOUBLE
# Optimized float mode
opt_float = -Wall -O2 -ffast-math
[torch]
# Need more verbosity ?
#verbose = 1
# Packages you want to use
packages =
# Magik key if you want several libraries
# for the same platform
#magic_key =
# Compiler, linker and archiver
compiler = g++
linker = g++
#archiver = g++ -shared -o
archiver = ar -rus
# Your librairies
# (for example "-lm", but not needed on most systems...)
libraries =
# Your includes
# (for example -I/usr/local/special)
includes =
# optimize mode
debug = opt
# debug mode
#debug = dbg
# double version
#floating = double
# float version
floating = float
# Debug double mode
dbg_double = -g -Wall -DUSE_DOUBLE -DDEBUG
# Debug float mode
dbg_float = -g -Wall -DDEBUG
# Optimized double mode
opt_double = -Wall -O2 -ffast-math -mcpu=i686 -march=i686 -malign-double -DUSE_DOUBLE
#opt_double = -Wall -O2 -ffast-math -mtune=i686 -march=i686 -malign-double -DUSE_DOUBLE
# Optimized float mode
opt_float = -Wall -O2 -ffast-math -mcpu=i686 -march=i686 -malign-double
#opt_float = -Wall -O2 -ffast-math -mtune=i686 -march=i686 -malign-double
# Note: gcc 3.4 does not support mcpu (replaced by mtune)