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
1a15c866
Commit
1a15c866
authored
2 years ago
by
aastorg2
Browse files
Options
Downloads
Patches
Plain Diff
last changes on teacher_base
parent
0b6342f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
teacher_base.py
+5
-4
5 additions, 4 deletions
teacher_base.py
with
5 additions
and
4 deletions
teacher_base.py
+
5
−
4
View file @
1a15c866
import
abc
import
itertools
from
typing
import
Dict
,
Hashable
,
List
,
Literal
,
Optional
,
Sequence
,
Tuple
#from typing import Dict, Hashable, List, Literal, Optional, Sequence, Tuple
from
typing
import
Dict
,
Hashable
,
List
,
Optional
,
Sequence
,
Tuple
import
gurobipy
as
gp
import
numpy
as
np
...
...
@@ -46,7 +47,7 @@ class DRealTeacherBase(TeacherBase):
]
def
__init__
(
self
,
name
:
str
,
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
:
Literal
[
1
,
2
,
"
inf
"
]
,
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
,
delta
:
float
=
0.001
)
->
None
:
self
.
_norm_ord
=
norm_ord
self
.
_delta
=
delta
...
...
@@ -140,7 +141,7 @@ class GurobiTeacherBase(TeacherBase):
TRIGVAR
=
{
"
vtype
"
:
gp
.
GRB
.
CONTINUOUS
,
"
lb
"
:
-
1.0
,
"
ub
"
:
1.0
}
def
__init__
(
self
,
name
:
str
,
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
:
Literal
[
1
,
2
,
"
inf
"
]
=
2
)
->
None
:
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
=
2
)
->
None
:
super
().
__init__
()
self
.
_gp_model
=
gp
.
Model
(
name
)
...
...
@@ -225,7 +226,7 @@ class GurobiTeacherBase(TeacherBase):
class
SymPyTeacherBase
(
TeacherBase
):
def
__init__
(
self
,
name
:
str
,
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
:
Literal
[
1
,
2
,
"
inf
"
]
)
->
None
:
state_dim
:
int
,
perc_dim
:
int
,
ctrl_dim
:
int
,
norm_ord
)
->
None
:
self
.
_norm_ord
=
norm_ord
# Old state variables
...
...
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