Skip to content

Commit 696e20d

Browse files
authored
Merge pull request #274 from mldiego/master
VNNCOMP 2025
2 parents 43886fa + 30c23b5 commit 696e20d

File tree

17 files changed

+685
-3326
lines changed

17 files changed

+685
-3326
lines changed

code/nnv/engine/nn/Prob_reach/CP_specification.m

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
function [Np , Nt , Ns] = CP_specification(delta, confidence_LB, dv , train_mode, type)
22

3+
4+
if ispc
5+
% Windows systems
6+
[~, sys] = memory;
7+
ramGB = sys.PhysicalMemory.Total / 1024^3;
8+
elseif isunix
9+
% Linux/macOS systems: use Java
10+
os = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
11+
method = os.getClass().getMethod('getTotalPhysicalMemorySize', []);
12+
totalRamBytes = method.invoke(os, []);
13+
ramGB = double(totalRamBytes) / (1024^3);
14+
else
15+
error('Unsupported operating system');
16+
end
17+
318
if strcmp(train_mode, 'gpu')
419

520

@@ -12,14 +27,9 @@
1227

1328
if ispc
1429
% Windows systems
15-
[~, sys] = memory;
16-
ramGB = sys.PhysicalMemory.Total / 1024^3;
1730
Np = computeNumVectors(ramGB, dv, type);
1831
elseif isunix
1932
% Linux/macOS systems: use Java
20-
runtime = java.lang.Runtime.getRuntime();
21-
ramBytes = runtime.totalMemory();
22-
ramGB = ramBytes / 1024^3;
2333
Np = computeNumVectors(ramGB, dv, type);
2434
else
2535
error('Unsupported operating system');
@@ -33,7 +43,16 @@
3343

3444
Ns = findMinimumM_binary(delta, confidence_LB);
3545

36-
Nt = floor(Ns/3);
46+
Yolo_found = 8112;
47+
48+
Ntdv = min( [8000*Yolo_found, Yolo_found*floor( 0.75 * ramGB*(1024^3) / (dv*8) ), Yolo_found*max(floor(Ns/10), 300)] );
49+
50+
Nt = floor(Ntdv/dv);
51+
52+
Nt = min(Nt , floor(Ns/10));
53+
54+
Npdv = max(100*Yolo_found, Yolo_found*min(Np , floor(Nt/3)));
55+
Np = min(Np , floor(Npdv / dv));
3756

3857

3958
if Np > Nt

0 commit comments

Comments
 (0)