Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs598mp-fall2021-proj
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chsieh16
cs598mp-fall2021-proj
Commits
82afc970
Commit
82afc970
authored
1 year ago
by
chsieh16
Browse files
Options
Downloads
Patches
Plain Diff
Increase precision
parent
26cd30b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dtree_learner.py
+1
-1
1 addition, 1 deletion
dtree_learner.py
dtree_teacher_base.py
+1
-1
1 addition, 1 deletion
dtree_teacher_base.py
with
2 additions
and
2 deletions
dtree_learner.py
+
1
−
1
View file @
82afc970
...
@@ -135,7 +135,7 @@ class DTreeLearner(LearnerBase):
...
@@ -135,7 +135,7 @@ class DTreeLearner(LearnerBase):
@staticmethod
@staticmethod
def
_rounding_feature_vectors
(
feature_vec_list
):
def
_rounding_feature_vectors
(
feature_vec_list
):
ROUND_TO
=
2
**
1
0
#
1024
ROUND_TO
=
2
**
1
5
#
32768
# Rounding to reduce hypothesis spaces
# Rounding to reduce hypothesis spaces
feature_vec_arr
=
np
.
array
(
feature_vec_list
)
feature_vec_arr
=
np
.
array
(
feature_vec_list
)
feature_vec_arr
=
np
.
round
(
feature_vec_arr
*
ROUND_TO
)
/
ROUND_TO
feature_vec_arr
=
np
.
round
(
feature_vec_arr
*
ROUND_TO
)
/
ROUND_TO
...
...
This diff is collapsed.
Click to expand it.
dtree_teacher_base.py
+
1
−
1
View file @
82afc970
...
@@ -7,7 +7,7 @@ from teacher_base import GurobiTeacherBase
...
@@ -7,7 +7,7 @@ from teacher_base import GurobiTeacherBase
class
DTreeGurobiTeacherBase
(
GurobiTeacherBase
):
class
DTreeGurobiTeacherBase
(
GurobiTeacherBase
):
PRECISION
=
10
**-
3
PRECISION
=
2
**-
20
Z3_VAR_RE
=
re
.
compile
(
r
"
(?P<var>\w+)_(?P<idx>\d+)
"
)
Z3_VAR_RE
=
re
.
compile
(
r
"
(?P<var>\w+)_(?P<idx>\d+)
"
)
def
_build_affine_expr
(
self
,
z3_expr
:
z3
.
ExprRef
):
def
_build_affine_expr
(
self
,
z3_expr
:
z3
.
ExprRef
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment