ARCS6
AR6-REV.24062600
読み取り中…
検索中…
一致する文字列を見つけられません
ARCS6
lib
BatchProcessor.hh
[詳解]
1
8
//
9
// Copyright (C) 2011-2020 Yokokura, Yuki
10
// This program is free software;
11
// you can redistribute it and/or modify it under the terms of the FreeBSD License.
12
// For details, see the License.txt file.
13
14
#ifndef BATCHPROCESSOR
15
#define BATCHPROCESSOR
16
17
#include <cassert>
18
#include "
Matrix.hh
"
19
20
// ARCS組込み用マクロ
21
#ifdef ARCS_IN
22
// ARCSに組み込まれる場合
23
#include "
ARCSassert.hh
"
24
#include "
ARCSeventlog.hh
"
25
#else
26
// ARCSに組み込まれない場合
27
#define arcs_assert(a) (assert(a))
28
#define PassedLog()
29
#define EventLog(a)
30
#define EventLogVar(a)
31
#endif
32
33
namespace
ARCS {
// ARCS名前空間
35
class
BatchProcessor
{
36
public
:
43
template
<
size_t
N,
size_t
D,
size_t
M>
44
static
Matrix<M,N>
GetMiniBatchData
(
const
Matrix<N,D>
& U,
const
size_t
i){
45
Matrix<N,M>
Buff;
46
size_t
k = 1;
47
for
(
size_t
j = (i - 1)*M; j < (i - 1)*M + M; j++){
48
setrow(Buff, getrow(U, j+1), k);
// ミニバッチサイズごとに切り出す
49
++k;
50
}
51
return
tp(Buff);
52
}
53
54
private
:
55
BatchProcessor
() =
delete
;
56
BatchProcessor
(
BatchProcessor
&& r) =
delete
;
57
BatchProcessor
(
const
BatchProcessor
&) =
delete
;
58
const
BatchProcessor
& operator=(
const
BatchProcessor
&) =
delete
;
59
~BatchProcessor
() =
delete
;
60
};
61
}
62
63
#endif
64
ARCSeventlog.hh
ARCS イベントログクラス
ARCSassert.hh
ARCS用ASSERTクラス
Matrix.hh
行列/ベクトル計算クラス(テンプレート版)
ARCS::BatchProcessor
バッチ処理器クラス
Definition
BatchProcessor.hh:35
ARCS::BatchProcessor::GetMiniBatchData
static Matrix< M, N > GetMiniBatchData(const Matrix< N, D > &U, const size_t i)
i番目のミニバッチデータを取得する関数
Definition
BatchProcessor.hh:44
ARCS::Matrix
行列/ベクトル計算クラス(テンプレート版)
Definition
Matrix.hh:44
構築:
1.11.0