Spaces:
Runtime error
Runtime error
init and change funct
Browse files
backend/disentangle_concepts.py
CHANGED
@@ -15,7 +15,7 @@ def get_separation_space(type_bin, annotations):
|
|
15 |
svc = SVC(gamma='auto', kernel='linear')
|
16 |
svc.fit(x_train, y_train)
|
17 |
print(svc.score(x_val, y_val))
|
18 |
-
imp_features =
|
19 |
return svc.coef_, imp_features
|
20 |
|
21 |
def regenerate_images(model, z, decision_boundary, min_epsilon=-3, max_epsilon=3, count=11):
|
|
|
15 |
svc = SVC(gamma='auto', kernel='linear')
|
16 |
svc.fit(x_train, y_train)
|
17 |
print(svc.score(x_val, y_val))
|
18 |
+
imp_features = len(np.abs(svc.coef_) > 2)
|
19 |
return svc.coef_, imp_features
|
20 |
|
21 |
def regenerate_images(model, z, decision_boundary, min_epsilon=-3, max_epsilon=3, count=11):
|
pages/1_Disentanglement.py
CHANGED
@@ -45,7 +45,7 @@ with open(concepts) as f:
|
|
45 |
if 'image_id' not in st.session_state:
|
46 |
st.session_state.image_id = 0
|
47 |
if 'concept_id' not in st.session_state:
|
48 |
-
st.session_state.concept_id = ''
|
49 |
|
50 |
# def on_change_random_input():
|
51 |
# st.session_state.image_id = st.session_state.image_id
|
|
|
45 |
if 'image_id' not in st.session_state:
|
46 |
st.session_state.image_id = 0
|
47 |
if 'concept_id' not in st.session_state:
|
48 |
+
st.session_state.concept_id = 'abstract'
|
49 |
|
50 |
# def on_change_random_input():
|
51 |
# st.session_state.image_id = st.session_state.image_id
|