Skip to content

Commit 355aefc

Browse files
committed
initial RNN for POMDP
1 parent 8996a4f commit 355aefc

30 files changed

Lines changed: 2035 additions & 1927 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ nbproject/
5050
*.pyc
5151
*data*
5252
MNIST
53+
test

GPUMat/cublastest/main.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
#include<armadillo>
1+
//#include<armadillo>
2+
#include <memory>
23
#include <cuda_runtime.h>
34
#include "cublas_v2.h"
5+
#include <iostream>
46
//#include "GPUMat.h"
57
#define N 10
68
void mat_prod_mat(const double* a, cublasOperation_t op_a, const double* b, cublasOperation_t op_b, double*c, int m, int n, int k);
@@ -11,20 +13,33 @@ void mat_prod_mat(const double* a, cublasOperation_t op_a, const double* b, cubl
1113

1214
int main(){
1315

16+
#if 0
1417
// arma::mat a;
1518
arma::mat a(N, N, arma::fill::randu);
1619
arma::mat b(N, N, arma::fill::randu);
1720
arma::mat c = a * b;
1821

1922
c.save("armaresult.txt",arma::raw_ascii);
2023

24+
#endif
25+
double *a;
26+
double *b, *c;
27+
a = (double *)malloc(N*N*sizeof(double));
28+
b = (double *)malloc(N*N*sizeof(double));
29+
c = (double *)malloc(N*N*sizeof(double));
2130

22-
23-
#if 1
24-
mat_prod_mat(a.memptr(), CUBLAS_OP_N, b.memptr(), CUBLAS_OP_N, c.memptr(), N, N, N);
31+
for (int i = 0; i < N*N; i++){
32+
a[i] = 1.0* i / (N*N);
33+
b[i] = -a[i];
34+
}
2535

36+
#if 1
37+
mat_prod_mat(a, CUBLAS_OP_N, b, CUBLAS_OP_N, c, N, N, N);
38+
for (int i = 0; i < N*N; i++){
39+
std::cout << c[i] << std::endl;
40+
}
2641

27-
c.save("gpuresult.txt", arma::raw_ascii);
42+
// c.save("gpuresult.txt", arma::raw_ascii);
2843
// double *aa = nullptr;
2944
// double *bb = nullptr;
3045
// double *cc = nullptr;

RNN/Makefile

Lines changed: 0 additions & 39 deletions
This file was deleted.

RNN/RNN.cpp

Lines changed: 0 additions & 224 deletions
This file was deleted.

RNN/RNN.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)