1
0
mirror of https://github.com/gryf/coach.git synced 2026-02-14 21:15:53 +01:00
This commit is contained in:
Gal Leibovich
2019-03-19 18:07:09 +02:00
committed by GitHub
parent 4a8451ff02
commit e3c7e526c7
38 changed files with 1003 additions and 87 deletions

View File

@@ -273,6 +273,11 @@ def create_files_signal(files, use_dir_name=False):
files_selector.value = filenames[0]
selected_file = new_signal_files[0]
# update x axis according to the file's default x-axis (which is the index, and thus the first column)
idx = x_axis_options.index(new_signal_files[0].csv.columns[0])
change_x_axis(idx)
x_axis_selector.active = idx
def display_files(files):
pause_auto_update()

View File

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from collections import OrderedDict
import os
from genericpath import isdir, isfile
@@ -26,12 +26,14 @@ import tkinter as tk
from tkinter import filedialog
import colorsys
from rl_coach.core_types import TimeTypes
patches = {}
signals_files = {}
selected_file = None
x_axis = ['Episode #']
x_axis_options = ['Episode #', 'Total steps', 'Wall-Clock Time']
x_axis_labels = ['Episode #', 'Total steps (per worker)', 'Wall-Clock Time (minutes)']
x_axis_options = [time_type.value.name for time_type in TimeTypes]
x_axis_labels = [time_type.value.label for time_type in TimeTypes]
current_color = 0
# spinner

View File

@@ -67,7 +67,12 @@ class SignalsFile(SignalsFileBase):
for k, v in new_csv.isna().all().items():
if v and k not in x_axis_options:
del new_csv[k]
new_csv.fillna(value=0, inplace=True)
# only fill the missing values that the previous interploation did not deal with (usually the ones before the
# first update to the signal was made). We do so again by interpolation (averaging the previous and the next
# values)
new_csv = ((new_csv.fillna(method='bfill') + new_csv.fillna(method='ffill')) / 2).fillna(method='bfill').fillna(
method='ffill')
self.csv = new_csv