update
This commit is contained in:
parent
f5c0ce3b36
commit
e9583c84a0
@ -4,6 +4,9 @@ project(GCTL_AI VERSION 1.0)
|
|||||||
# 添加配置配件编写的函数
|
# 添加配置配件编写的函数
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# 添加编译选项
|
# 添加编译选项
|
||||||
option(GCTL_AI_OPENMP "Use the OpenMP library" OFF)
|
option(GCTL_AI_OPENMP "Use the OpenMP library" OFF)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ if [[ $# == 0 || ${1} == "help" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
package=gctl_potential
|
package=gctl_ai
|
||||||
address=/opt/stow
|
address=/opt/stow
|
||||||
taress=/usr/local
|
taress=/usr/local
|
||||||
option="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${address}/${package}"
|
option="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${address}/${package}"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# 设置编译选项
|
# 设置编译选项
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||||
# 设置库文件的输出地址
|
# 设置库文件的输出地址
|
||||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
||||||
# 设定库源文件文件夹
|
# 设定库源文件文件夹
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "gctl/core.h"
|
#include "gctl/core.h"
|
||||||
#include "gctl/io.h"
|
#include "gctl/io.h"
|
||||||
#include "gctl/algorithm.h"
|
#include "gctl/algorithms.h"
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifdef GCTL_AI_OPENMP
|
#ifdef GCTL_AI_OPENMP
|
||||||
|
@ -392,8 +392,8 @@ void gctl::dnn::init_network(double mu, double sigma, unsigned int seed)
|
|||||||
weights_.resize(wd_size_);
|
weights_.resize(wd_size_);
|
||||||
ders_.resize(wd_size_);
|
ders_.resize(wd_size_);
|
||||||
|
|
||||||
gctl::random(weights_, mu, sigma, RdNormal, seed);
|
weights_.random_float(mu, sigma, RdNormal, seed);
|
||||||
gctl::random(ders_, mu, sigma, RdNormal, seed);
|
ders_.random_float(mu, sigma, RdNormal, seed);
|
||||||
|
|
||||||
status_ = Initialized;
|
status_ = Initialized;
|
||||||
return;
|
return;
|
||||||
|
@ -82,7 +82,7 @@ std::string gctl::dnn_hlayer::get_activation_name() const
|
|||||||
void gctl::dnn_hlayer::cal_valid_padding_idx(array<int> &idx, int i, int j, int i_rows, int i_cols, int p_rows, int p_cols, int s_rows, int s_cols)
|
void gctl::dnn_hlayer::cal_valid_padding_idx(array<int> &idx, int i, int j, int i_rows, int i_cols, int p_rows, int p_cols, int s_rows, int s_cols)
|
||||||
{
|
{
|
||||||
idx.resize(p_rows*p_cols);
|
idx.resize(p_rows*p_cols);
|
||||||
idx.assign_all(-1);
|
idx.assign(-1);
|
||||||
|
|
||||||
int row_st = i*s_rows;
|
int row_st = i*s_rows;
|
||||||
int col_st = j*s_cols;
|
int col_st = j*s_cols;
|
||||||
@ -100,7 +100,7 @@ void gctl::dnn_hlayer::cal_valid_padding_idx(array<int> &idx, int i, int j, int
|
|||||||
void gctl::dnn_hlayer::cal_same_padding_idx(array<int> &idx, int i, int j, int i_rows, int i_cols, int p_rows, int p_cols, int s_rows, int s_cols, int u_pad, int l_pad)
|
void gctl::dnn_hlayer::cal_same_padding_idx(array<int> &idx, int i, int j, int i_rows, int i_cols, int p_rows, int p_cols, int s_rows, int s_cols, int u_pad, int l_pad)
|
||||||
{
|
{
|
||||||
idx.resize(p_rows*p_cols);
|
idx.resize(p_rows*p_cols);
|
||||||
idx.assign_all(-1);
|
idx.assign(-1);
|
||||||
|
|
||||||
int row_st = i*s_rows - u_pad;
|
int row_st = i*s_rows - u_pad;
|
||||||
int col_st = j*s_cols - l_pad;
|
int col_st = j*s_cols - l_pad;
|
||||||
|
@ -131,7 +131,7 @@ void gctl::convolution::backward_propagation(const array<double> &all_weights, c
|
|||||||
der_in_.assign_all(0.0);
|
der_in_.assign_all(0.0);
|
||||||
|
|
||||||
all_ders_count_.resize(chls_*f_rows_*f_cols_);
|
all_ders_count_.resize(chls_*f_rows_*f_cols_);
|
||||||
all_ders_count_.assign_all(0);
|
all_ders_count_.assign(0);
|
||||||
|
|
||||||
der_in_count_.resize(w_is_, o_is_*chls_);
|
der_in_count_.resize(w_is_, o_is_*chls_);
|
||||||
der_in_count_.assign_all(0);
|
der_in_count_.assign_all(0);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define _GCTL_DNN_OLAYER_H
|
#define _GCTL_DNN_OLAYER_H
|
||||||
|
|
||||||
#include "gctl/core.h"
|
#include "gctl/core.h"
|
||||||
#include "gctl/algorithm.h"
|
#include "gctl/algorithms.h"
|
||||||
|
|
||||||
namespace gctl
|
namespace gctl
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user