version bump
This commit is contained in:
parent
44bc283f4f
commit
35a2297ab2
6 changed files with 16 additions and 9 deletions
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
using namespace tp;
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
void loadImage(Buffer<halnf>& output, const char* name) {
|
||||
int x, y, channels_in_file;
|
||||
unsigned char* loadedImage = stbi_load(name, &x, &y, &channels_in_file, 4);
|
||||
|
|
@ -28,7 +30,9 @@ void loadImage(Buffer<halnf>& output, const char* name) {
|
|||
void loadNN(FCNN& nn) {
|
||||
ArchiverLocalConnection<true> archiver;
|
||||
|
||||
archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true));
|
||||
if (std::filesystem::exists(std::filesystem::path("NumRec.wb"))) {
|
||||
archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true));
|
||||
}
|
||||
|
||||
if (archiver.connection.getConnectionStatus().isOpened()) {
|
||||
archiver % nn;
|
||||
|
|
@ -56,7 +60,7 @@ void executeCmd(const char* imageName) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
const char* imageName = "digit.png";
|
||||
const char* imageName = "tmp2.png";
|
||||
|
||||
if (argc == 2) {
|
||||
imageName = argv[1];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <filesystem>
|
||||
#include "FCNN.hpp"
|
||||
#include "LocalConnection.hpp"
|
||||
|
||||
|
|
@ -71,7 +72,9 @@ struct NumberRec {
|
|||
{
|
||||
ArchiverLocalConnection<true> archiver;
|
||||
|
||||
archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true));
|
||||
if (std::filesystem::exists(std::filesystem::path("NumRec.wb"))) {
|
||||
archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true));
|
||||
}
|
||||
|
||||
if (archiver.connection.getConnectionStatus().isOpened()) {
|
||||
archiver % nn;
|
||||
|
|
@ -215,7 +218,7 @@ int main() {
|
|||
|
||||
auto batchSize = trainRange.idxDiff() / numBatches;
|
||||
|
||||
for (auto epoch : IterRange(1)) {
|
||||
for (auto epoch : IterRange(10)) {
|
||||
printf("Epoch %i\n", epoch.index());
|
||||
|
||||
for (auto batchIdx : IterRange(trainRange.idxDiff() / batchSize)) {
|
||||
|
|
@ -241,5 +244,5 @@ int main() {
|
|||
// app.displayImage(i);
|
||||
}
|
||||
|
||||
printf("\n\nIncorrect - %i out of %i (%f)\n\n", errors, testRange.idxDiff(), (halnf) errors / (halnf) testRange.idxDiff());
|
||||
printf("\n\nIncorrect - %i out of %i error percentage (%f)\n\n", errors, testRange.idxDiff(), (halnf) errors / (halnf) testRange.idxDiff());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue