Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BSD
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SunMaple
BSD
Commits
964df446
Commit
964df446
authored
Apr 23, 2025
by
chengshuyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add BSD_features
parent
7807d33f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
src/BSD.cpp
+6
-5
src/BSD.h
+4
-2
No files found.
src/BSD.cpp
View file @
964df446
...
@@ -65,11 +65,11 @@ class BSD_features{
...
@@ -65,11 +65,11 @@ class BSD_features{
public
:
public
:
int
BSD_depth
;
int
BSD_depth
;
int
BSD_area
;
int
BSD_area
;
int
BSD_area_layers
[
parameter_input_bit_width
];
double
accuracy
;
double
accuracy
;
int
BSD_area_layers
[
parameter_input_bit_width
];
int
accuracy_layers
[
parameter_input_bit_width
];
int
accuracy_layers
[
parameter_input_bit_width
];
//int nodes_for_each_start_node[parameter_max_BDD_width];
int
area_for_each_start_node
[
parameter_output_bit_width
];
};
};
void
search_order
();
void
search_order
();
int
search_reward
(
BSD_features
BSD_features_0
);
int
search_reward
(
BSD_features
BSD_features_0
);
...
@@ -141,7 +141,8 @@ int BSD_execute(int variable_order_number,int* variable_order,BSD_features BSD_f
...
@@ -141,7 +141,8 @@ int BSD_execute(int variable_order_number,int* variable_order,BSD_features BSD_f
for
(
int
zi
=
0
;
zi
<
parameter_input_bit_width
;
zi
++
){
for
(
int
zi
=
0
;
zi
<
parameter_input_bit_width
;
zi
++
){
variable_order
[
zi
]
=
BDD_class_main
.
most_influence
[
zi
];
variable_order
[
zi
]
=
BDD_class_main
.
most_influence
[
zi
];
tmp_split_nodes
[
zi
]
=
BDD_class_main
.
split_nodes_each_layer
[
zi
];
BSD_features_0
.
BSD_area_layers
[
zi
]
=
BDD_class_main
.
split_nodes_each_layer
[
zi
];
BSD_features_0
.
accuracy_layers
[
zi
]
=
BDD_class_main
.
accuracy_each_layer
[
zi
];
}
}
BSD_features_0
.
BSD_depth
=
BDD_class_main
.
total_BDD_depth
+
1
;
BSD_features_0
.
BSD_depth
=
BDD_class_main
.
total_BDD_depth
+
1
;
...
@@ -298,7 +299,7 @@ void search_order(){
...
@@ -298,7 +299,7 @@ void search_order(){
best_area_depth
=
tmp_BDD_depth
;
best_area_depth
=
tmp_BDD_depth
;
for
(
int
vi
=
0
;
vi
<
tmp_BDD_depth
;
vi
++
){
for
(
int
vi
=
0
;
vi
<
tmp_BDD_depth
;
vi
++
){
best_variable_order
[
vi
]
=
variable_order
[
vi
];
best_variable_order
[
vi
]
=
variable_order
[
vi
];
best_BDD_split_nodes
[
vi
]
=
tmp_split_node
s
[
vi
];
best_BDD_split_nodes
[
vi
]
=
BSD_features_0
.
BSD_area_layer
s
[
vi
];
}
}
parameter_early_stop_split_nodes
=
best_area
+
10
;
parameter_early_stop_split_nodes
=
best_area
+
10
;
}
}
...
...
src/BSD.h
View file @
964df446
...
@@ -135,7 +135,9 @@ public:
...
@@ -135,7 +135,9 @@ public:
int
BSD_variable_order
[
parameter_input_bit_width
];
int
BSD_variable_order
[
parameter_input_bit_width
];
int
BSD_variable_order_number
;
int
BSD_variable_order_number
;
int
*
split_nodes_each_layer
;
int
split_nodes_each_layer
[
parameter_input_bit_width
+
1
];
int
accuracy_each_layer
[
parameter_input_bit_width
+
1
];
BDD_class
(){
BDD_class
(){
most_influence
=
new
int
[
parameter_input_bit_width
];
most_influence
=
new
int
[
parameter_input_bit_width
];
...
@@ -157,7 +159,6 @@ public:
...
@@ -157,7 +159,6 @@ public:
left_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
left_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
right_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
right_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
split_nodes_each_layer
=
new
int
[
parameter_input_bit_width
+
1
];
};
};
...
@@ -706,6 +707,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -706,6 +707,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
cout
<<
endl
;
cout
<<
endl
;
split_nodes_each_layer
[
i
]
=
total_split_nodes
;
split_nodes_each_layer
[
i
]
=
total_split_nodes
;
accuracy_each_layer
[
i
]
=
((
total_finish_weight
)
/
pow
(
2
.
0
,
20
))
/
double
(
parameter_output_bit_width
);
cout
<<
"BSD "
<<
BDD_id
<<
" nodes = "
<<
total_nodes_amount
<<
endl
;
cout
<<
"BSD "
<<
BDD_id
<<
" nodes = "
<<
total_nodes_amount
<<
endl
;
cout
<<
"BSD "
<<
BDD_id
<<
" split nodes = "
<<
total_split_nodes
;
cout
<<
"BSD "
<<
BDD_id
<<
" split nodes = "
<<
total_split_nodes
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment