Tensorboard: Regex filter: Multiple string and/or wildcards

Created on 12 Jul 2018  路  6Comments  路  Source: tensorflow/tensorboard

Hello,
It seems to me that the regex filter does not currently support filtering multiple strings neither using wild cards.
As I'm doing a hyper-parameter search with 4 different parameters (and will soon there will 6 parameters) this make comparing data cumbersome.
Also due to this it can't filter with 2 parameters if they are not one after another.
Is there a way to do such search?
If not, wouldn't it be a desirable feature?

Most helpful comment

The filter is a regex, so if you wanted to filter for strings with both those substrings you would want to type in v2_050_96.*hidden_units_10-10 where the parameters are joined with .* and in the same order that they appear in the name of the run.

Which demo are you referring to that uses , to join parameters?

All 6 comments

Can you provide examples of the exact names you're trying to filter and what the regexes you tried were?

My files names looks like this:
learning_rate_0.01__module_httpstfhubdevgoogleimagenetmobilenet_v2_050_96feature_vector2__hidden_units_10-10__logs
and I use this code to generate the string:

`unsafe_chars = [":","/","\\", "."]
def robust_toString(l,joiner = "-"):
    if type(l) is str: # case string
        safe_str = [c for c in l if c not in unsafe_chars]
        return ('').join(safe_str)
    try: # case iterable
        str_list = map(str,l)
        str_ = joiner.join(str_list)
        if str_ == "":
            return "none"
        return str_
    except: # case not iterable nor string
        return str(l)

def make_hparam_string(params):
    s = ""
    for k in params.keys():
        s = s+k+"_"+robust_toString(params[k])+"__"
    return s`

Right now my dict contains: hidden units layers, learning rate and module name, but I plan to add a few more parameter such as usage of bias and initializers and otpimizers.

I can filter on one parameter, but say I want to filter upon both topology of hidden layer and the pretrained model: my sub strings would look like this, but I can't have both.

v2_050_96

right now, putting blankspace or commas result in the filter removing all of my runs as there are no such characters in my run names. Or is it that there are certain character that are expected to be used to enable such features? I saw in the tensorboard demo "," are used to separate parameters

The filter is a regex, so if you wanted to filter for strings with both those substrings you would want to type in v2_050_96.*hidden_units_10-10 where the parameters are joined with .* and in the same order that they appear in the name of the run.

Which demo are you referring to that uses , to join parameters?

Thanks @nfelt , It works greats.
I'm referring to the conference at tensorflow summit 2017. Which is the example provided on tensorflow guide to tensorboard:
Tensorboard guide
Tensorflow summit

Glad to hear that works for you. Yeah, the , used in that demo is just a literal comma used in naming the event file directory; it isn't treated specially in terms of doing the regex filtering.

.* works like a charm when the runs/scalars/histograms to filter share a naming convention and parameters, and you want both to be true (e.g. v2_050_96.*hidden_units_10-10 will filter runs with hidden_units=(10, 10) AND v2=(50, 96)).

In case anybody is trying to filter several runs/metrics that DO NOT share the same string regexp (as I've been for a bit of time now), you can list several tags with (tag0|tag1|tag2), e.g (hidden_units_10-10|v2_050_96) to show all runs with hidden_units=(10, 10) OR v2=(50, 96); and (var1|var5).*loss to show all losses for var1 AND var5

Was this page helpful?
0 / 5 - 0 ratings