Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,17 +24,17 @@ def plot_loss_rates(df, type):
|
|
| 24 |
x = np.linspace(0, 1, 1000)
|
| 25 |
loss_rates = []
|
| 26 |
labels = ['32', '64', '128', '256', '512', '1024']
|
| 27 |
-
|
| 28 |
df = df.drop(columns=['Step'])
|
| 29 |
for col in df.columns:
|
| 30 |
-
y = df[col].dropna().values
|
| 31 |
f = interp1d(np.linspace(0, 1, len(y)), y)
|
| 32 |
loss_rates.append(f(x))
|
| 33 |
fig, ax = plt.subplots()
|
| 34 |
for i, loss_rate in enumerate(loss_rates):
|
| 35 |
ax.plot(x, loss_rate, label=labels[i])
|
| 36 |
ax.legend()
|
| 37 |
-
ax.set_title(f'Loss rates for {type} model')
|
| 38 |
ax.set_xlabel('Training steps')
|
| 39 |
ax.set_ylabel('Loss rate')
|
| 40 |
return fig
|
|
|
|
| 24 |
x = np.linspace(0, 1, 1000)
|
| 25 |
loss_rates = []
|
| 26 |
labels = ['32', '64', '128', '256', '512', '1024']
|
| 27 |
+
#drop the column step
|
| 28 |
df = df.drop(columns=['Step'])
|
| 29 |
for col in df.columns:
|
| 30 |
+
y = df[col].dropna().astype('float', errors = 'ignore').dropna().values
|
| 31 |
f = interp1d(np.linspace(0, 1, len(y)), y)
|
| 32 |
loss_rates.append(f(x))
|
| 33 |
fig, ax = plt.subplots()
|
| 34 |
for i, loss_rate in enumerate(loss_rates):
|
| 35 |
ax.plot(x, loss_rate, label=labels[i])
|
| 36 |
ax.legend()
|
| 37 |
+
ax.set_title(f'Loss rates for a {type} parameter model')
|
| 38 |
ax.set_xlabel('Training steps')
|
| 39 |
ax.set_ylabel('Loss rate')
|
| 40 |
return fig
|