- use RnnTextHelper

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@837 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-18 20:14:56 +00:00
parent 1c206de402
commit cb066a5a5f
3 changed files with 179 additions and 106 deletions
+41
View File
@@ -0,0 +1,41 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: RnnTextHelper.hpp
* Author: jens
*
* Created on 18. Januar 2022, 19:12
*/
#ifndef RNNTEXTHELPER_HPP
#define RNNTEXTHELPER_HPP
#include <armadillo>
class RnnTextHelper
{
public:
RnnTextHelper();
RnnTextHelper(const RnnTextHelper& orig) = delete;
virtual ~RnnTextHelper();
const char punctuation[5] = {' ', '.', '!', '?', 0};
static constexpr int NUM_CODES = 1 + 26 + 10;
static constexpr int SEQ_LENGTH = 2;
static int char_is(char c, const char *pTable);
static int ch2idx(char c);
static char idx2ch(int index);
static arma::mat createTraining(const std::string &filename, size_t seq_len);
private:
};
#endif /* RNNTEXTHELPER_HPP */