Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HParams: Add button to make the runs table full screen #6451

Merged
merged 3 commits into from
Jun 26, 2023

Conversation

rileyajones
Copy link
Contributor

@rileyajones rileyajones commented Jun 24, 2023

Motivation for features / changes

When the hparams in time series feature is rolled out, the runs table will have the potential to be much wider than it currently is. To support this we want to be able to make the table full screen.

To full screen the table a user must click button which appears just to the right on the runs table.

Screenshots of UI changes (or N/A)

Snap button appears on hover
image

The button is hidden when not hovering
image

The runs table can still be resized manually
acabf57c-e8dc-4c46-a6c0-bf0fe2c6ac80

Look, it's full screen
image

A button appears to collapse the table when it is full screen
image

Copy link
Contributor

@JamesHollyer JamesHollyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase and take the screenshots with the new style. I think the table will expand to fill the space. Just make sure that works/looks good.

readonly width$: Observable<number> = this.store
.select(getSideBarWidthInPercent)
.pipe(
combineLatestWith(this.runsTableFullScreen$),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly this works. However, I thought combineLatestWith would cause this pipe to not trigger an update when runsTableFullScreen changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are mixing up combineLatestWith and withLatestFrom (I know, it's a hard mistake to make /s). Combine latest with does trigger this to re-emit.

If it did not then I would not be able to toggle full screen after resizing it.
9c6394e3-d258-47ee-8954-9964f1f57f35

// Ensure the button is on the right side then add 2px for the drag target.
left: calc(100% + 2px);
top: 0;
z-index: 10;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This seems arbitrary. Is anything else at z-index 1 or 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed arbitrary, I changed it to 1

@rileyajones rileyajones marked this pull request as ready for review June 26, 2023 17:13
User:
Can you please extract all the code on this page? https://www.tensorflow.org/tutorials/text/word2vec

Model:
Sure. Here is the code from the TensorFlow tutorial on word2vec:

```python
import tensorflow as tf

path_to_file = tf.keras.utils.get_file('shakespeare.txt',
                                       'https://storage.googleapis.com/download.tensorflow.org/data/shakespeare.txt')

def custom_standardization(input_data):
  lowercase = tf.strings.lower(input_data)
  return tf.strings.regex_replace(lowercase, '[%s]' % re.escape(string.punctuation), '')

vocab_size = 4096
sequence_length = 10

vectorize_layer = tf.keras.layers.TextVectorization(
    standardize=custom_standardization,
    max_tokens=vocab_size,
    output_mode='int',
    output_sequence_length=sequence_length)

text_ds = tf.data.TextDataset(path_to_file).map(lambda x: x)
vectorize_layer.adapt(text_ds)

inverse_vocab = vectorize_layer.get_vocabulary()
print(inverse_vocab[:20])

train_ds = text_ds.shuffle(1000).batch(32)
validation_ds = text_ds.batch(32)

model = tf.keras.models.Sequential([
  vectorize_layer,
  tf.keras.layers.Embedding(vocab_size, 128),
  tf.keras.layers.GlobalAveragePooling1D(),
  tf.keras.layers.Dense(1, activation='sigmoid')
])
@rileyajones rileyajones merged commit 1a3d26d into tensorflow:master Jun 26, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants