Category : artificial-intelligence

I installed some libraries with: sudo apt-get install libomp-dev sudo apt-get install libarmadillo-dev sudo apt-get install libmlpack-dev When I try to build/execute/debug the app in eclipse it seems it builds all the dependencies again. It takes long time for a simple program. Dependencies in CMakeLists.txt: find_package(OpenMP REQUIRED) target_compile_options(${PROJECT_NAME} INTERFACE -fopenmp) target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX mlpack PUBLIC ..

Read more

I am trying tom implement a MiniMax Function for Othello game and I created two functions: MiniMax Function to return best moves EvalMiniMax to return the heuristic values Evaluate Heuristics double EvalMiniMax(ARR _state, int depth, int curPlayer) { if (depth == 0) return Heuristic(_state); vector<Point> nextMoves = get_valid_spots(_state, curPlayer); // Skipped turn if (nextMoves.size() == ..

Read more

I got c10 error when I define a FP16 tensor and use torch::max() and torch::sqrt(). The code are shown as follows: float test_float[3][3] = { {1.0, 2.0, 3.0}, {4.0, 5.0, 6.0 },{7.0, 8.0, 9.0} }; torch::Tensor test_float_tensor = torch::from_blob(test_float, { 3, 3 }).to(at::kCPU).to(torch::kFloat16); torch::sqrt(test_float_tensor); torch::max(test_float_tensor, 1, true); If I change the FP16 tensor into FP32 ..

Read more

The tutorial gives an example about using packed_accessor64 to access tensor elements efficiently as follows. However, I still do not know how to use packed_accessor64. Can anyone give me a more specific example? Thanks. __global__ void packed_accessor_kernel( PackedTensorAccessor64<float, 2> foo, float* trace) { int i=threadIdx.x gpuAtomicAdd(trace, foo[i][i]) } torch::Tensor foo = torch::rand({12, 12}); // assert ..

Read more

I am using the latest Tesseract API for C++ and I followed the last answer on this post to link what is necessary. These are my includes: #include<iostream> #include<Windows.h> #include<opencv2/opencv.hpp> #include<stdint.h> #include<tesseract/baseapi.h> #include<leptonica/allheaders.h> When I try to initialize the api pointer with: tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); it gives me the following relevant console errors ..

Read more