Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing reference to the non-existing memory #303

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
a225c09
Eliminate compile time warning
shleym2000 Mar 29, 2024
fbeb8c2
Eliminate warning
shleym2000 Mar 29, 2024
9bc1b8e
Standard library header <codecvt> is removed in C++17
shleym2000 Mar 29, 2024
4e7e40b
Merge branch 'dev' into patch-3
Apr 5, 2024
6187c5d
Merge branch 'dev' into patch-3
shleym2000 Apr 9, 2024
6be0ee0
Merge branch 'dev' into patch-3
shleym2000 Apr 17, 2024
45e87b9
Update normalization_layer_3d.h to avoid warning
shleym2000 Apr 17, 2024
f204891
Update loss_index.cpp to eliminate warnings
shleym2000 Apr 17, 2024
0be8054
Merge branch 'dev' into patch-3
Apr 17, 2024
2086569
Restored fixes after merging
Apr 17, 2024
7c45e1d
Merge branch 'dev' into patch-3
shleym2000 Apr 20, 2024
3ff4a46
Parameter should be const if you want library to be compilable
shleym2000 Apr 20, 2024
64611f3
Merge branch 'dev' into patch-3
Apr 29, 2024
9d29af9
Merge branch 'dev' into patch-3
May 1, 2024
acc0723
No changes to loss_index.cpp is needed anymore
shleym2000 May 2, 2024
ef6a92b
Merge branch 'dev' into patch-3
shleym2000 May 4, 2024
8786f56
Merge branch 'dev' into patch-3
shleym2000 May 15, 2024
98bd824
Merge branch 'dev' into patch-3
shleym2000 May 17, 2024
8471842
Merge branch 'dev' into patch-3
May 21, 2024
f883557
Merge branch 'dev' into patch-3
shleym2000 May 31, 2024
5e5984b
Merge branch 'dev' into patch-3
Jun 10, 2024
65f7f11
Merge branch 'dev' into patch-3
Jun 17, 2024
94e6293
Merge branch 'dev' into patch-3
shleym2000 Jun 18, 2024
a9fe15c
Merge branch 'dev' into patch-3
shleym2000 Jun 19, 2024
6a7f8ae
Merge branch 'dev' into patch-3
Jun 21, 2024
52913d6
Merge branch 'dev' into patch-3
Jun 24, 2024
3633c0d
Dependable compiling
Jun 27, 2024
0b3c393
Merge branch 'dev' into patch-3
shleym2000 Jul 4, 2024
aa00a46
Merge branch 'dev' into patch-3
Jul 5, 2024
297892d
Fix issues with compiling under OPENNN_DEBUG
Jul 5, 2024
a25588f
Correction
Jul 5, 2024
c277b42
Correcting mistake
Jul 5, 2024
e4b2920
Merge branch 'dev' into patch-3
shleym2000 Jul 10, 2024
222fa97
Merge branch 'dev' into patch-3
shleym2000 Jul 11, 2024
cf406b8
Merge branch 'dev' into With_My_PRs
Jul 15, 2024
cef61c8
Merge branch 'dev' into patch-3
shleym2000 Jul 17, 2024
4ae4e4e
Merge branch 'dev' into patch-3
shleym2000 Jul 20, 2024
ed5e6ca
Merge branch 'dev' into patch-3
Jul 22, 2024
823a8c0
Merge branch 'dev' into patch-3
Jul 23, 2024
d549641
Merge branch 'dev' into patch-3
Jul 24, 2024
72b2f9c
Merge branch 'dev' into patch-3
Jul 24, 2024
ee73c9d
Merge branch 'dev' into patch-3
Jul 25, 2024
3f0191f
Merge branch 'dev' into patch-3
Jul 26, 2024
b187a2b
Merge branch 'dev' into patch-3
shleym2000 Jul 27, 2024
a06ffb1
synch
shleym2000 Jul 27, 2024
4b85ccd
synch
shleym2000 Jul 27, 2024
2f4b84e
Merge branch 'dev' into patch-3
Jul 29, 2024
ec093ab
Merge branch 'dev' into patch-3
Jul 30, 2024
ba84d9e
Merge branch 'dev' into patch-3
shleym2000 Jul 31, 2024
214aaf8
Merge branch 'dev' into patch-3
Aug 1, 2024
91b92b6
Merge branch 'dev' into patch-3
shleym2000 Aug 5, 2024
a0f02e1
Merge branch 'dev' into patch-3
Aug 9, 2024
c5bac9c
Merge branch 'dev' into patch-3
Aug 12, 2024
e23868e
codecvt_utf8 is obsolete
Aug 12, 2024
2c7fb0c
Merge branch 'dev' into patch-3
Aug 14, 2024
2650cc0
Merge branch 'dev' into patch-3
Aug 15, 2024
386d965
Merge branch 'dev' into patch-3
Aug 16, 2024
c76b73e
Merge branch 'dev' into patch-3
shleym2000 Aug 17, 2024
3335a6a
Merge branch 'dev' into patch-3
Aug 19, 2024
4c3eb0c
Merge branch 'dev' into patch-3
shleym2000 Aug 20, 2024
455e80a
Merge branch 'dev' into patch-3
shleym2000 Aug 24, 2024
2e3b462
Merge branch 'dev' into patch-3
Aug 26, 2024
a441bb4
Merge branch 'dev' into patch-3
shleym2000 Aug 27, 2024
37c516f
Merge branch 'dev' into patch-3
Aug 29, 2024
6d25896
Merge branch 'dev' into patch-3
Sep 5, 2024
5192367
Merge branch 'dev' into patch-3
Sep 6, 2024
d267ac3
Merge branch 'dev' into patch-3
Sep 12, 2024
dff9eda
Merge branch 'dev' into patch-3
Sep 13, 2024
e789991
Merge branch 'dev' into patch-3
Sep 13, 2024
79335df
Merge branch 'dev' into patch-3
Sep 16, 2024
370629a
Merge branch 'dev' into patch-3
Sep 17, 2024
61f4dcb
Merge branch 'dev' into patch-3
Sep 18, 2024
375745d
Keeping up with the "dev" branch
Sep 18, 2024
3cdc837
Merge branch 'dev' into patch-3
Sep 19, 2024
845c56d
Merge branch 'dev' into patch-3
shleym2000 Sep 21, 2024
638109e
Merge branch 'dev' into patch-3
shleym2000 Sep 23, 2024
b9ec2ee
Merge branch 'dev' into patch-3
Sep 25, 2024
fd9fa6e
Merge branch 'dev' into patch-3
Sep 25, 2024
01b3810
Merge branch 'dev' into patch-3
shleym2000 Sep 29, 2024
0d2875a
Merge branch 'dev' into patch-3
Sep 30, 2024
0203abd
Merge branch 'dev' into patch-3
Oct 9, 2024
e4fece8
Merge branch 'dev' into patch-3
Oct 14, 2024
737469b
Merge branch 'dev' into patch-3
Oct 16, 2024
1743346
Merge branch 'dev' into patch-3
shleym2000 Oct 19, 2024
aa3f0a5
Merge branch 'dev' into patch-3
Oct 21, 2024
d30fef0
Merge branch 'dev' into patch-3
shleym2000 Oct 24, 2024
cd5dd68
Merge branch 'dev' into patch-3
Oct 25, 2024
b117ad1
Merge branch 'dev' into patch-3
shleym2000 Oct 26, 2024
e1e6be2
Merge branch 'dev' into patch-3
shleym2000 Oct 26, 2024
ff0f6ad
Merge branch 'dev' into patch-3
shleym2000 Oct 27, 2024
58c2ae7
Merge branch 'dev' into patch-3
Oct 28, 2024
b799e30
More usage of the obsolete codecvt_utf8() had to be eliminated
Oct 28, 2024
e2ffcf5
Merge branch 'dev' into patch-3
Oct 28, 2024
751e31b
Fixed codecvt_utf8 issue in 4 places
Oct 28, 2024
961ca6f
Merge branch 'dev' into patch-3
shleym2000 Oct 29, 2024
060a2a3
Merge branch 'dev' into patch-3
Oct 29, 2024
d60016a
Merge branch 'dev' into patch-3
Oct 31, 2024
e16adf8
Merge branch 'dev' into patch-3
Nov 4, 2024
d1a7942
Merge branch 'dev' into patch-3
shleym2000 Nov 5, 2024
24763cc
Merge branch 'dev' into patch-3
shleym2000 Nov 6, 2024
b341a8d
Merge branch 'dev' into patch-3
shleym2000 Nov 6, 2024
a89ea95
Merge branch 'dev' into patch-3
Nov 7, 2024
1223df3
Merge branch 'dev' into patch-3
shleym2000 Nov 10, 2024
3cb342a
Merge branch 'dev' into patch-3
Nov 13, 2024
7bfa829
Merge branch 'dev' into patch-3
shleym2000 Nov 16, 2024
848b980
Merge branch 'dev' into patch-3
shleym2000 Nov 21, 2024
f0842c0
Catching up with latest DEV branch changes
shleym2000 Nov 21, 2024
4459178
Merge branch 'dev' into patch-3
shleym2000 Nov 23, 2024
d74b0b9
cleanup
shleym2000 Nov 24, 2024
d1a224c
Merge branch 'dev' into patch-3
Nov 26, 2024
1bb3253
Merge branch 'dev' into patch-3
shleym2000 Nov 28, 2024
2b7e9e3
synchronization
shleym2000 Nov 28, 2024
0cfda90
Preventing memory corruption
shleym2000 Nov 28, 2024
3d7046d
Merge branch 'dev' into patch-3
shleym2000 Nov 30, 2024
f0ec5f7
No need in changes to data_set.h anymore
shleym2000 Nov 30, 2024
8418cc0
One issue is gone
shleym2000 Nov 30, 2024
0648924
Merge branch 'dev' into patch-3
Dec 2, 2024
01f5eab
Merge branch 'dev' into patch-3
Dec 3, 2024
f25f2cc
Merge branch 'dev' into patch-3
shleym2000 Dec 4, 2024
42e2ead
Merge branch 'dev' into patch-3
Dec 6, 2024
b0e8f06
Merge branch 'dev' into patch-3
Dec 13, 2024
226ba94
Merge branch 'dev' into patch-3
Dec 16, 2024
2bd289e
Merge branch 'dev' into patch-3
shleym2000 Dec 18, 2024
9787dc7
Merge branch 'dev' into patch-3
shleym2000 Dec 18, 2024
badd4b9
fix
shleym2000 Dec 18, 2024
0b24e4e
Merge branch 'dev' into patch-3
Dec 19, 2024
08bbef5
Merge branch 'dev' into patch-3
shleym2000 Dec 21, 2024
0a0f55c
Merge branch 'dev' into patch-3
Dec 23, 2024
2c3d2ce
Merge branch 'dev' into patch-3
shleym2000 Dec 24, 2024
f26cbe3
Merge branch 'dev' into patch-3
Dec 26, 2024
c5ab472
Merge branch 'dev' into patch-3
Dec 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opennn/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

#define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS

#define _CRT_SECURE_NO_WARNINGS
#ifndef _CRT_SECURE_NO_WARNINGS
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevents from warnings about duplicate _CRT_SECURE_NO_WARNINGS definitions for almost every file being compiled

#define _CRT_SECURE_NO_WARNINGS
#endif

// For numeric limits

Expand Down
28 changes: 7 additions & 21 deletions opennn/data_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8420,9 +8420,7 @@ void DataSet::save_data_binary(const string& binary_data_file_name) const

if(regex_search(binary_data_file_name, accent_regex))
{
wstring_convert<codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(binary_data_file_name);
file.open(file_name_wide, ios::binary);
file.open(string_to_wide_string(binary_data_file_name), ios::binary);
}
else
{
Expand Down Expand Up @@ -8488,9 +8486,7 @@ void DataSet::load_data_binary()

if(regex_search(data_source_path, accent_regex))
{
wstring_convert<codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide, ios::binary);
file.open(string_to_wide_string(data_source_path), ios::binary);
}
else
{
Expand Down Expand Up @@ -9350,9 +9346,7 @@ void DataSet::read_csv_1()

if(std::regex_search(data_source_path, accent_regex))
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
std::wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}else
{
file.open(data_source_path.c_str());
Expand Down Expand Up @@ -9601,9 +9595,7 @@ void DataSet::read_csv_2_simple()

if(regex_search(data_source_path, accent_regex))
{
wstring_convert<codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}else
{
file.open(data_source_path.c_str());
Expand Down Expand Up @@ -9708,9 +9700,7 @@ void DataSet::read_csv_3_simple()

if(std::regex_search(data_source_path, accent_regex))
{
wstring_convert<std::codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}else
{
file.open(data_source_path.c_str());
Expand Down Expand Up @@ -9842,9 +9832,7 @@ void DataSet::read_csv_2_complete()

if(regex_search(data_source_path, accent_regex))
{
wstring_convert<codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}
else
{
Expand Down Expand Up @@ -10005,9 +9993,7 @@ void DataSet::read_csv_3_complete()

if(regex_search(data_source_path, accent_regex))
{
wstring_convert<codecvt_utf8<wchar_t>> conv;
wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}
else
{
Expand Down
27 changes: 25 additions & 2 deletions opennn/data_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <algorithm>
#include <cmath>
#include <codecvt>
#include <cstdlib>
#include <ctime>
#include <exception>
Expand All @@ -39,7 +38,11 @@
#include "correlation.h"
#include "scaling.h"

//using namespace std;
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif

using namespace Eigen;

// Filesystem namespace
Expand All @@ -64,6 +67,26 @@ using namespace Eigen;
namespace opennn
{

#ifdef _WIN32
inline std::wstring string_to_wide_string(const std::string& string)
{
if (string.empty())
{
return L"";
}

const auto size_needed = MultiByteToWideChar(CP_UTF8, 0, string.data(), (int)string.size(), nullptr, 0);
if (size_needed <= 0)
{
throw std::runtime_error("MultiByteToWideChar() failed: " + std::to_string(size_needed));
}

std::wstring result(size_needed, 0);
MultiByteToWideChar(CP_UTF8, 0, string.data(), (int)string.size(), result.data(), size_needed);
return result;
}
#endif

/// This class represents the concept of data set for data modelling problems, such as approximation, classification or forecasting.

///
Expand Down
4 changes: 1 addition & 3 deletions opennn/language_data_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,9 +1479,7 @@ void LanguageDataSet::read_csv_3_language_model()

if (std::regex_search(data_source_path, accent_regex))
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
std::wstring file_name_wide = conv.from_bytes(data_source_path);
file.open(file_name_wide);
file.open(string_to_wide_string(data_source_path));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion opennn/loss_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ Tensor<type, 1> LossIndex::calculate_numerical_gradient()

for(Index i = 0; i < parameters_number; i++)
{
h = 0.01; // calculate_h(parameters(i));
h = static_cast<type>(0.01); // calculate_h(parameters(i));

parameters_forward(i) += h;

Expand Down