Moved neuralnet classes into own library
This commit is contained in:
@@ -1,35 +1,6 @@
|
|||||||
QT += core
|
TEMPLATE = subdirs
|
||||||
QT -= gui widgets
|
|
||||||
|
|
||||||
DBLIBS +=
|
SUBDIRS += neuralnetdemo \
|
||||||
|
neuralnetlib
|
||||||
|
|
||||||
TARGET = neuralnet
|
neuralnetdemo.depends += neuralnetlib
|
||||||
|
|
||||||
PROJECT_ROOT = ..
|
|
||||||
|
|
||||||
SOURCES += main.cpp \
|
|
||||||
neuron.cpp \
|
|
||||||
neurallayer.cpp \
|
|
||||||
neuralnet.cpp \
|
|
||||||
neuralfactor.cpp \
|
|
||||||
debug.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
neuralfactor.h \
|
|
||||||
interfaces/ineuronreceptor.h \
|
|
||||||
interfaces/ineuronsignal.h \
|
|
||||||
interfaces/ineuron.h \
|
|
||||||
interfaces/ineurallayer.h \
|
|
||||||
interfaces/ineuralnet.h \
|
|
||||||
neuron.h \
|
|
||||||
neurallayer.h \
|
|
||||||
neuralnet.h \
|
|
||||||
debug.h
|
|
||||||
|
|
||||||
FORMS +=
|
|
||||||
|
|
||||||
RESOURCES +=
|
|
||||||
|
|
||||||
TRANSLATIONS +=
|
|
||||||
|
|
||||||
include($${PROJECT_ROOT}/app.pri)
|
|
||||||
|
18
neuralnetdemo/neuralnetdemo.pro
Normal file
18
neuralnetdemo/neuralnetdemo.pro
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
QT += core
|
||||||
|
QT -= gui widgets
|
||||||
|
|
||||||
|
DBLIBS += neuralnetlib
|
||||||
|
|
||||||
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
HEADERS +=
|
||||||
|
|
||||||
|
FORMS +=
|
||||||
|
|
||||||
|
RESOURCES +=
|
||||||
|
|
||||||
|
TRANSLATIONS +=
|
||||||
|
|
||||||
|
include($${PROJECT_ROOT}/app.pri)
|
@@ -1,9 +1,6 @@
|
|||||||
#ifndef DEBUG_H
|
#pragma once
|
||||||
#define DEBUG_H
|
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
bool initDebug();
|
bool initDebug();
|
||||||
void debug(const QString &line);
|
void debug(const QString &line);
|
||||||
|
|
||||||
#endif // DEBUG_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef INEURALLAYER_H
|
#pragma once
|
||||||
#define INEURALLAYER_H
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
@@ -17,5 +16,3 @@ public:
|
|||||||
virtual QList<INeuron *> &neurons() = 0;
|
virtual QList<INeuron *> &neurons() = 0;
|
||||||
virtual const QList<INeuron *> &neurons() const = 0;
|
virtual const QList<INeuron *> &neurons() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INEURALLAYER_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef INEURALNET_H
|
#pragma once
|
||||||
#define INEURALNET_H
|
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
@@ -19,5 +18,3 @@ public:
|
|||||||
virtual const INeuralLayer *hiddenLayer() const = 0;
|
virtual const INeuralLayer *hiddenLayer() const = 0;
|
||||||
virtual const INeuralLayer *outputLayer() const = 0;
|
virtual const INeuralLayer *outputLayer() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INEURALNET_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef INEURON_H
|
#pragma once
|
||||||
#define INEURON_H
|
|
||||||
|
|
||||||
#include "ineuronsignal.h"
|
#include "ineuronsignal.h"
|
||||||
#include "ineuronreceptor.h"
|
#include "ineuronreceptor.h"
|
||||||
@@ -20,5 +19,3 @@ public:
|
|||||||
virtual NeuralFactor *bias() = 0;
|
virtual NeuralFactor *bias() = 0;
|
||||||
virtual const NeuralFactor *bias() const = 0;
|
virtual const NeuralFactor *bias() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INEURON_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef INEURONRECEPTOR_H
|
#pragma once
|
||||||
#define INEURONRECEPTOR_H
|
|
||||||
|
|
||||||
template <class Key, class T> class QMap;
|
template <class Key, class T> class QMap;
|
||||||
|
|
||||||
@@ -12,5 +11,3 @@ public:
|
|||||||
virtual QMap<INeuronSignal *, NeuralFactor *> &input() = 0;
|
virtual QMap<INeuronSignal *, NeuralFactor *> &input() = 0;
|
||||||
virtual const QMap<INeuronSignal *, NeuralFactor *> &input() const = 0;
|
virtual const QMap<INeuronSignal *, NeuralFactor *> &input() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INEURONRECEPTOR_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef INEURONSIGNAL_H
|
#pragma once
|
||||||
#define INEURONSIGNAL_H
|
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
@@ -9,5 +8,3 @@ public:
|
|||||||
virtual qreal output() const = 0;
|
virtual qreal output() const = 0;
|
||||||
virtual void setOutput(qreal output) = 0;
|
virtual void setOutput(qreal output) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INEURONSIGNAL_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef NEURALFACTOR_H
|
#pragma once
|
||||||
#define NEURALFACTOR_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
@@ -32,5 +31,3 @@ private:
|
|||||||
qreal m_weight;
|
qreal m_weight;
|
||||||
qreal m_delta;
|
qreal m_delta;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEURALFACTOR_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef NEURALLAYER_H
|
#pragma once
|
||||||
#define NEURALLAYER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -29,5 +28,3 @@ private:
|
|||||||
NeuralNet *m_neuralNet;
|
NeuralNet *m_neuralNet;
|
||||||
QList<INeuron *> m_neurons;
|
QList<INeuron *> m_neurons;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEURALLAYER_H
|
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef NEURALNET_H
|
#pragma once
|
||||||
#define NEURALNET_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -48,5 +47,3 @@ private:
|
|||||||
INeuralLayer *m_hiddenLayer;
|
INeuralLayer *m_hiddenLayer;
|
||||||
INeuralLayer *m_outputLayer;
|
INeuralLayer *m_outputLayer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEURALNET_H
|
|
33
neuralnetlib/neuralnetlib.pro
Normal file
33
neuralnetlib/neuralnetlib.pro
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
QT += core
|
||||||
|
QT -= gui widgets
|
||||||
|
|
||||||
|
DBLIBS +=
|
||||||
|
|
||||||
|
PROJECT_ROOT = ../..
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
neuron.cpp \
|
||||||
|
neurallayer.cpp \
|
||||||
|
neuralnet.cpp \
|
||||||
|
neuralfactor.cpp \
|
||||||
|
debug.cpp
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
neuralfactor.h \
|
||||||
|
neuron.h \
|
||||||
|
neurallayer.h \
|
||||||
|
neuralnet.h \
|
||||||
|
debug.h \
|
||||||
|
interfaces/ineuronreceptor.h \
|
||||||
|
interfaces/ineuronsignal.h \
|
||||||
|
interfaces/ineuron.h \
|
||||||
|
interfaces/ineurallayer.h \
|
||||||
|
interfaces/ineuralnet.h
|
||||||
|
|
||||||
|
FORMS +=
|
||||||
|
|
||||||
|
RESOURCES +=
|
||||||
|
|
||||||
|
TRANSLATIONS +=
|
||||||
|
|
||||||
|
include($${PROJECT_ROOT}/lib.pri)
|
@@ -1,5 +1,4 @@
|
|||||||
#ifndef NEURON_H
|
#pragma once
|
||||||
#define NEURON_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
@@ -55,5 +54,3 @@ private:
|
|||||||
qreal m_error;
|
qreal m_error;
|
||||||
NeuralFactor *m_bias;
|
NeuralFactor *m_bias;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEURON_H
|
|
Reference in New Issue
Block a user