prakharg24 commited on
Commit
f425ca1
·
verified ·
1 Parent(s): 5647120

Update my_pages/ica.py

Browse files
Files changed (1) hide show
  1. my_pages/ica.py +15 -6
my_pages/ica.py CHANGED
@@ -92,26 +92,35 @@ def render():
92
  # --- Dummy points scattered inside triangle ---
93
  # (x, y, text)
94
  locations = [
95
- (0.9, 0.1, r"$\mathbf{Random\ Seeds}$\nHighly arbitrary, low conventional, low intentional: random", "left", "bottom"),
96
- (0.7, 0.25, "Example B", "left", "bottom"),
97
- (0.5, 0.6, "Example C", "left", "bottom"),
98
- (0.2, 0.4, "Example D", "left", "bottom"),
99
- (0.8, 0.5, "Example E", "left", "bottom"),
 
100
  ]
101
 
102
  torch_radius = 0.177 # how far the "torch" illuminates
103
 
 
104
  # Illuminate nearby points
105
- for (x, y, label, ha, va) in locations:
106
  dist = np.linalg.norm([x - point[0], y - point[1]])
107
  if dist <= torch_radius:
108
  ax.scatter(x, y, c="red", s=50, zorder=6)
109
  ax.text(x, y + 0.03, label, ha=ha, va=va, color="red", zorder=6)
 
110
  else:
111
  ax.scatter(x, y, c="red", s=50, zorder=6, alpha=0.3)
112
 
113
  st.pyplot(fig)
114
 
 
 
 
 
 
 
115
  st.markdown("---")
116
  col1, col2, col3, col4 = st.columns([2, 1, 1, 1])
117
  with col3:
 
92
  # --- Dummy points scattered inside triangle ---
93
  # (x, y, text)
94
  locations = [
95
+ (0.9, 0.1, "Random Seeds" "Random Seeds are highly arbitrary, without any convention or intentionality.", "left", "bottom"),
96
+ (0.3, 0.1, "Neural networks for Tabular Data", "Using neural networks of some arbitrary size (hidden layers) for a setting where \
97
+ they are not needed is highly conventional, a bit arbitrary, and has very low intentionality.", "right", "bottom"),
98
+ (0.35, 0.6, "Pre-trained LLM for a Complex Task", "Using a high performing LLM for a complex task is intentional, however, it also has \
99
+ conventionality to it, as a specialized model could have worked, depending on context.\
100
+ No arbitrariness.", "right", "bottom"),
101
  ]
102
 
103
  torch_radius = 0.177 # how far the "torch" illuminates
104
 
105
+ text_to_show = "Explanations\n"
106
  # Illuminate nearby points
107
+ for (x, y, label, labeltext, ha, va) in locations:
108
  dist = np.linalg.norm([x - point[0], y - point[1]])
109
  if dist <= torch_radius:
110
  ax.scatter(x, y, c="red", s=50, zorder=6)
111
  ax.text(x, y + 0.03, label, ha=ha, va=va, color="red", zorder=6)
112
+ text_to_show += label + ": " + labeltext + "\n"
113
  else:
114
  ax.scatter(x, y, c="red", s=50, zorder=6, alpha=0.3)
115
 
116
  st.pyplot(fig)
117
 
118
+ if len(text_to_show) > 0:
119
+ st.markdown(
120
+ f"<div style='text-align:center; color:#c0392b; font-size:20px; font-weight:bold; margin:14px 0;'>{text_to_show}</div>",
121
+ unsafe_allow_html=True,
122
+ )
123
+
124
  st.markdown("---")
125
  col1, col2, col3, col4 = st.columns([2, 1, 1, 1])
126
  with col3: