[Critical] Very high loss rate at first few tokens (classifier free guidance not working)

@lucidrains
This is a issue I'm having a while, the cross-attention is very weak at the start of the sequence.
When the transformer starts with no tokens it will relay on the cross-attention but unfortunately the cross-attention doesn't work for the first token(s).
Proof
To prove this I trained a dataset of 500 models that have unique text embeddings and no augmentations, then I only took the first 6 tokens of the mesh and train on that.
After training for 8hrs, it's still stuck at 1.03 loss.
Without fixing this issue, the auto-regression without a prompt of tokens will never work.
This problem has been ongoing for a while but I thought it was a issue of training and using a model that has been trained on the first few tokens would resolve this. However that isn't the case.
Real-life example
To highlight the issue, I trained a model on the 13k dataset then removed all the augmentation copies and removed models with duplicate labels.
If I provide it with the first 2 tokens as a prompt it will autocomplete without no problem and no visual issues, however if i provide it with 1 or 0 tokens it fails completely.
Checked the logits
I investigated this further and checked the logits when it generated the first token, the probability for correct token was at the 9th most probable token.
I tried to implement a beam search with beam width of 5 but since the first token has such a low probability, it would require a lot of beams which probably will work but this seems like a brute force solution isn't very good.
It may work to do a beam search of 20 and then kill of the solutions which seems to have a low probability/entropy, but this seems like a bandage solution that might not work with scaling up meshgpt.
Why is this a problem?
The first tokens are very important for the generation since it's a domino effect, if it gets the incorrect token at the start, the generation will fail since it relays to much on the sequence to auto-correct.
It's like if the sentence is "Dog can be a happy animal" and it predicts "Human" as the first token, it won't be able to auto-correct since sentence is already messed up and the chances it will auto-correct to "Human got a dog which can be a happy animal" is extremely hard.
Possible solution
Since the cross-attention is used only on the "big" decoder, can it also be implemented for the fine decoder?
Attempts to fix:

I've tried removing the fine decoder and fine gateloop
I also tried increasing cross_attn_num_mem_kv but found no signifiant changes.
I replaced theTextEmbeddingReturner with AttentionTextConditioner but still no changes.
Tried using different text encoder such as BGE and CLIP.

This has been a problem for a long time and I've mentioned in the issues threads as a note so I'm creating a issue for it since it really prevents me from releasing fine-tuned models.
I got a model ready to go that can predict 13k models but since the first tokens make the autoregressive generation makes it impossible, I've not released it yet.
Here is some images over the loss:

This sounds critical indeed. Hopefully it's an easy fix.

@lucidrains
I think I've resolved this issue by tokenizing the text and insert it at the start of the codes and add a special token to indicate the start of the mesh tokens.
However the downside with this is that the transformer needs to use a larger vocab, any idea how to resolve this issue?
I tested it on a smaller dataset but it seems to be working!
I think this will also guide the transformer much better.

@MarcusLoppe That is fantastic! Have you posted the fix somewhere?

@MarcusLoppe That is fantastic! Have you posted the fix somewhere?

Not yet, my current way is bit hacky and requires bit of a rewrite to properly implement.
I'm currently verifying the solution on bit bigger dataset and will hammer out all the possible bugs.

@MarcusLoppe hey Marcus, thanks for identifying this issue
have you tried turning off CFG?

@MarcusLoppe hey Marcus, thanks for identifying this issue
have you tried turning off CFG? if you haven't, one thing to try is simply turning off CFG for the first few tokens. i think i've come across papers where they studied at which steps CFG is even effective
also try turning off CFG and do greedy sampling and see what happens. if that doesn't work, there is some big issue

With CFG you mean classifier-free guidance?
Not sure how I would go about that, do you mean setting cond_drop_prob to 0.0?
I've tried that and as far as I can tell the CFG just returns the embedding without any modifications (if cond_drop_prob  is set to 0 since then it won't mask the text embedding).
The issue lies with when the transformer has a empty sequence and only the text embedding to go from. The text embedding doesn't seem to help very much so it doesn't know what token to pick, hence the huge loss at the start.

@MarcusLoppe oh, maybe it is already turned off
so CFG is turned on by setting cond_scale > 1. when invoking .generate
if you haven't been using cond_scale, then perhaps it was never turned on

@MarcusLoppe oh crap, do i only append the start token for the fine transformer?? 🤦 yes you are correct, it is never conditioned then

thank you, this is a real issue then. i'll add cross attention to the fine transformer later today

@MarcusLoppe oh crap, do i only append the start token for the fine transformer?? 🤦 yes you are correct, it is never conditioned then

thank you, this is a real issue then. i'll add cross attention to the fine transformer later today

Awesome, however my 'fix' seems to be working however.
By provide the text in the form of tokens in the sequence the fine-decoder will get the text context and it also helps creating a stronger relationship with the tokens and speed up the training.
So the tokens it trains on is like: "chair  XXXXXXXX" (where X is the mesh tokens).
The downside is that it needs a bigger vocab which slows the training bit but the stronger relationship between the mesh tokens and the text seems to be working :)

@MarcusLoppe yup, your way is also legit 😄
you have a bright future Marcus! finding this issue, the analysis, coming up with your own solution; none of that is trivial

@MarcusLoppe yup, your way is also legit 😄
you have a bright future Marcus! finding this issue, the analysis, coming up with your own solution; none of that is trivial

Thank you very much 😄  Although it took a while I think I've learned one or two things on the way 😄

thank you, this is a real issue then. i'll add cross attention to the fine transformer later today
edit: another cheap solution would be to project text embeddings, pool it, and just use that as the initial sos token

I don't think the cross-attention will be enough, as per my last reply i removed the fine-decoder and gateloop and had the same issue.
If you think about the multimodal generative models they never start from token 0. For a example the vision models has a prompt with a specific request from the user.
So it has the first few tokens and some sort of goal or idea what to generate, then the cross-attention will do it's job and provide the addition context.
So the generative has a more  'probabilistic path' start to get to the correct answer.
I think projecting the text embeddings might be the better way in this case.

@MarcusLoppe yup i went with the pooled text embedding summed to the sos token for now
let me know if that fixes things (or not) 🤞

@MarcusLoppe yup i went with the pooled text embedding summed to the sos token for now
let me know if that fixes things (or not) 🤞

Awesome! I'll check it out 🚀
However with the last x-transformers update I'm getting the error below.
The num_mem_kv doesn't seem to be picked up or trimmed by:
"attn_kwargs, kwargs = groupby_prefix_and_trim('attn_', kwargs)"
And the dim_head in meshgpt isn't being passed correctly as it should be: "attn_dim_head "
-> 1057 assert len(kwargs) == 0, f'unrecognized kwargs passed in {kwargs.keys()}'
1059 dim_head = attn_kwargs.get('dim_head', DEFAULT_DIM_HEAD)
1061 self.dim = dim
AssertionError: unrecognized kwargs passed in dict_keys(['dim_head', 'num_mem_kv'])

@MarcusLoppe ah yes, those should have attn_ prepended, should be fixed in the latest version

@lucidrains
Alright here is some results.
I first trained using a small set of 350 models, which have a total of x5 augments each. It only contains 39 unique labels so there are some overlap with the texts.
Previous test just produced a blob of triangles, this time it outputted all tents and a blob.

I then took the same model and removed all augmentations so it's x1 of each model and unique texts for each model.
This outputted somewhat better results but it's still not following the text guidance.

I checked the logits and the first token generate was for a bench model and the correct was at the 19th placement and had the value 0.013.
And as you can see, the loss at the start didn't show any improvements :/

For sanity check I trained a fresh model on the x1 to 0.004 loss but as you can see it didn't help. Might made it worse.

I did the same test previously using my method with tokenized text I was able to get all perfect results using the x1 (did not test x5), so that would indicate that the issue that the cross attention relationship when there is no tokens isn't strong enough.
Btw I tested just adding fake tokens by increasing the codebook and used e.g codebook_size +1 (eos at +2) at the start but that didn't change anything.

@MarcusLoppe ok, i threw in cross attention conditioning for fine transformer in 1.2.3
if that doesn't work, i'll just spend some time refactoring so the start token is in the coarse transformer. that would work for sure, as it is equivalent to your solution, except the text tokens do not undergo self attention

@MarcusLoppe thanks for running the experiments!

@MarcusLoppe ok, i threw in cross attention conditioning for fine transformer in 1.2.3
if that doesn't work, i'll just spend some time refactoring so the start token is in the coarse transformer. that would work for sure, as it is equivalent to your solution, except the text tokens do not undergo self attention

The loss rate improved much better over the epochs, however it had some downside.
Before it generate 100 tokens/s, now it went down to 80 t/s, but I prefer this version much more I think since this will cut down the training speed.
Since inference time increased so did the per epoch, using a 2k dataset it went from 02:28 to 02:42, however I saw better loss improvements.
Unfortunately it did not work :(
However something to note is that it worked before using the demo mesh dataset that consist of 9 meshes.
Cond_scale 1:

Cond_scale 3:

@MarcusLoppe ah, thank you
ok, final try
will have to save this for late next week if it doesn't work

@MarcusLoppe ah, thank you
ok, final try
will have to save this for late next week if it doesn't work

It worked better, here is the result of training it on 39 models with unique labels, however you can still see a spike in the start of the sequence meaning that it might not be resolved.

Using my method I managed to get these results below, it manages to generate quite complex objects.
However the start is still bit weak, it would help if you manage to make it so the sos token is in the coarse transformer, this will help the training time a lot since it can reduce the vocab size from 32k to 2k  :)
I've also experiment with using 3 tokens per triangle and the autoencoder seems to be working, however it makes the training progression for the transformer slower. But considering that VRAM requirement for training on 800 triangle meshes would go from 22GB to 9GB and half the generation time, I think that is something worth exploring.
However I think that the autoencoder could also benefit from getting the text embeddings, I tried to pass it as the context in the linear attention layer but since it requires the the same shape as the quantized input it won't accept it nor I think it would be very VRAM friendly to duplicate the text embedding to the number of faces.
Do you think there is a easy fix for this? I think it would reduce the codebook size a lot and help create codes with closer relationships to the text which would benefit the transformer a lot.

@MarcusLoppe that is much better (an order of magnitude!) thank you for the experiments Marcus!
i know how to improve it (can add multiple sos to give the attention more surface area)

@MarcusLoppe i'll get back to this later this week 🙏

@MarcusLoppe oh, the sos token has already been moved to the coarse transformer in the latest commit. that's where the improvement you are seeing is coming from

@MarcusLoppe that is much better (an order of magnitude)! thank you for the experiments Marcus!
i know how to improve it (can add multiple sos to give the attention more surface area)

Oh awesome, however the loss got very low (0.006) for these results, for the bigger datasets the loss gets to about 0.01 until it needs like 1000 epochs to reach similar loss.
So some further improvements would be nice! :smile:
Any thoughts about the text embedding aware decoder?

@MarcusLoppe yup, we can try multiple sos tokens, then if that doesn't work, i'll build in the option to use prepended text embeddings (excised before fine transformer)
and yes, text embedding aware autoencoder is achievable! in fact, the original soundstream paper did this

@MarcusLoppe yup, we can try multiple sos tokens, then if that doesn't work, i'll build in the option to use prepended text embeddings (so like the solution you came up with, additional sos excised or pooled before fine transformer)
and yes, text embedding aware autoencoder is achievable! in fact, the original soundstream paper did this

Alright, I've tested the latest patch.
I tested using sos tokens in the amount of: 1,2,4,8, 16, however I was unable to get any usable meshes from it.
I sanity checked by reverting to the previous commit and was able to generate valid mesh.
To generate the mesh I tested setting the cond_scale to 3, turned off the kv_cache but they just outputted a blob.
However the loss definitely is smoothed over, as you an see the loss doesn't sticks up as it did before (I've might had a too small sample size so ignore the loss values).
I think the issue might be that when they get averaged together they lose their meaning or they get to complex to understand.
Also the below prevented me from testing using 1 sos token, since it get's packed but never unpacked.
        if exists(cache):
            cached_face_codes_len = cached_attended_face_codes.shape[-2]
            cached_face_codes_len_without_sos = cached_face_codes_len - 1

            need_call_first_transformer = face_codes_len > cached_face_codes_len_without_sos
        else:
            # auto prepend sos token
            sos = repeat(self.sos_token, 'n d -> b n d', b = batch)
            face_codes, packed_sos_shape = pack([sos, face_codes], 'b * d')

            # if no kv cache, always call first transformer
            need_call_first_transformer = True

         if need_call_first_transformer:
                    if exists(self.coarse_gateloop_block):
                        face_codes, coarse_gateloop_cache = self.coarse_gateloop_block(face_codes, cache = coarse_gateloop_cache)
        ..............
        ..............

        if not exists(cache) and self.num_sos_tokens > 1:
            sos_tokens, attended_face_codes = unpack(attended_face_codes, packed_sos_shape, 'b * d')
            pooled_sos_token = reduce(sos_tokens, 'b n d -> b 1 d', 'mean')
            attended_face_codes = torch.cat((pooled_sos_token, attended_face_codes), dim = 1)

Previous commit ( https://github.com/lucidrains/meshgpt-pytorch/commit/34f2806cccc759b9d00198858cd6019a61985fc3)

New commit:
num_sos_tokens = 3

num_sos_tokens = 4

num_sos_tokens = 8

num_sos_tokens = 16

@MarcusLoppe ok, let's go with your intuition and just grab the last sos token

@MarcusLoppe ok, let's go with your intuition and just grab the last sos token

Don't listen to me :) I think you are onto something, I don't think that it's possible for all the nuances in a text can be contained in a single token. As you can see, the loss is smoother and not sticking up, so it did something right.
Do you have any good reason why you used mean pooling?
Otherwise I'll do some testing with replacing it with some attention layer

oh I actually kept the multiple sos tokens, but listened to your suggestion not to use mean pooling, and instead grab the last sos tokens to forward to fine transformer

was just reading a paper claiming that turning off CFG for earlier tokens leads to better results https://arxiv.org/html/2404.13040v1 should get this into the CFG repo at some point 🤔

oh I actually kept the multiple sos tokens, but listened to your suggestion not to use mean pooling, and instead grab the last sos token to forward to fine transformer

Oh alright, well I've haven't checked out that patch yet but the attention work really good!  😄   🚀
I trained on 350 models and it seems like it have a very strong text conditional.
The only change I did was to add a simple linear layer! :)  This might have been the last step (not counting the last 10 "last steps")!
I'll get back to you with the results of just using the last sos token.
Using the texts: 'bed', 'sofa', 'monitor', 'bench', 'chair', 'table'
I then generate it in 3 rows, first one is with temp at 0.0 and 0.5 for the others.
As you can see, it has a very strong text relationship :)

@MarcusLoppe awesome! did you mean that you used an extra linear on the mean pooled sos tokens?

haha, these assets remind me of a game i played a ton of when i was a teen
yes im old

@MarcusLoppe awesome! did you mean that you used an extra linear on the mean pooled sos tokens?

Hey, so I added these changes.
self.attention_weights = nn.Linear(dim, 1, bias=False)

attention_scores = F.softmax(self.attention_weights(sos_tokens), dim=1)
pooled_sos_token = torch.sum(attention_scores * sos_tokens, dim=1, keepdim=True)

It worked very good when I dealt with 350 objects but when I scaled up to 2k objects it didn't work as good 😭
I tried implementing more then one layer but it got worse when I made it too complex.
Also I'm not quite sure about doing mean over the tokens since that might promote similar tokens.
Do you have any other idea then to prepend the tokenized text? 😄  It really hurts the performance if it needs to predict over 66k (50k+16k) tokens.
Here is some results, I took 355 samples and for each sample I found other items in the dataset that had the same type of label e.g. "chair" and "tall chair". This would give me a good idea about how well it keeps to the text condition.
As you can see, the attention one had the best results using 2 or 4 tokens,.
Latest commit:
Token 1: Correct = 169, Incorrect = 186
Token 2: Correct = 234, Incorrect = 121
Token 3: Correct = 353, Incorrect = 2
Token 4: Correct = 354, Incorrect = 1
All below, attention linear layer:
1 num_sos_tokens:
Token 1: Correct = 74, Incorrect = 281
Token 2: Correct = 205, Incorrect = 150
Token 3: Correct = 352, Incorrect = 3
Token 4: Correct = 354, Incorrect = 1
2 num_sos_tokens:
Token 1: Correct = 237, Incorrect = 118
Token 2: Correct = 220, Incorrect = 135
Token 3: Correct = 353, Incorrect = 2
Token 4: Correct = 354, Incorrect = 1
4 num_sos_tokens:
Token 1: Correct = 237, Incorrect = 118
Token 2: Correct = 205, Incorrect = 150
Token 3: Correct = 351, Incorrect = 4
Token 4: Correct = 354, Incorrect = 1
8 num_sos_tokens:
Token 1: Correct = 126, Incorrect = 229
Token 2: Correct = 220, Incorrect = 135
Token 3: Correct = 351, Incorrect = 4
Token 4: Correct = 354, Incorrect = 1

@MarcusLoppe awesome! did you mean that you used an extra linear on the mean pooled sos tokens?

Hey, so I added a Linear and pooled the tokens as below:
self.attention_weights = nn.Linear(dim, 1, bias=False)

attention_scores = F.softmax(self.attention_weights(sos_tokens), dim=1)
pooled_sos_token = torch.sum(attention_scores * sos_tokens, dim=1, keepdim=True)

It worked very good when I dealt with 350 objects but when I scaled up to 2k objects it didn't work as good 😭 I tried implementing more then one layer but it got worse when I made it too complex. Also I'm not quite sure about doing mean over the tokens since that might promote similar tokens.
Do you have any other idea then to prepend the tokenized text? 😄 It really hurts the performance if it needs to predict over 66k (50k+16k) tokens.
Here is some results, I took 355 samples and for each sample I found other items in the dataset that had the same type of label e.g. "chair" and "tall chair". This would give me a good idea about how well it keeps to the text condition.
As you can see, the attention one had the best results using 2 or 4 tokens, however the commit you did before also had some good results.
Latest commit using 4 sos tokens try not pooling all the sos tokens and instead using the last one Token 1: Correct = 169, Incorrect = 186 Token 2: Correct = 234, Incorrect = 121 Token 3: Correct = 353, Incorrect = 2 Token 4: Correct = 354, Incorrect = 1
The commit before the last one move the concatenation of the sos token so it is always Token 1: Correct = 258, Incorrect = 97 Token 2: Correct = 215, Incorrect = 140 Token 3: Correct = 354, Incorrect = 1 Token 4: Correct = 354, Incorrect = 1
All below, attention linear layer:
1 num_sos_tokens: Token 1: Correct = 74, Incorrect = 281 Token 2: Correct = 205, Incorrect = 150 Token 3: Correct = 352, Incorrect = 3 Token 4: Correct = 354, Incorrect = 1
2 num_sos_tokens: Token 1: Correct = 237, Incorrect = 118 Token 2: Correct = 220, Incorrect = 135 Token 3: Correct = 353, Incorrect = 2 Token 4: Correct = 354, Incorrect = 1
4 num_sos_tokens: Token 1: Correct = 237, Incorrect = 118 Token 2: Correct = 205, Incorrect = 150 Token 3: Correct = 351, Incorrect = 4 Token 4: Correct = 354, Incorrect = 1
8 num_sos_tokens: Token 1: Correct = 126, Incorrect = 229 Token 2: Correct = 220, Incorrect = 135 Token 3: Correct = 351, Incorrect = 4 Token 4: Correct = 354, Incorrect = 1
4 num_sos_tokens using mean:
pooled_sos_token = reduce(sos_tokens, 'b n d -> b 1 d', 'mean')
attention_scores = F.softmax(self.attention_weights(pooled_sos_token ), dim=1)
pooled_sos_token = torch.sum(attention_scores * sos_tokens, dim=1, keepdim=True)

Token 1: Correct = 158, Incorrect = 197 Token 2: Correct = 214, Incorrect = 141 Token 3: Correct = 344, Incorrect = 11 Token 4: Correct = 350, Incorrect = 5 Token 5: Correct = 355, Incorrect = 0

you successfully applied the attention pooling from enformer! 👏 👏
thank you for the breakdown, going to default the number of sos tokens to 4 🙏

I think you misunderstood me, the results are bad since the first tokens most of the cases was not remotely connected. When I used the exact same label to find valid codes it failed very hard.
I only trained on the first 36 tokens so I could speed up the testing, but currently I'm training it on the full sequence so I can show you the result of the generations.
I'll post the results later on

@MarcusLoppe ah, you aren't referring to the number of sos tokens, but to the token number in the main sequence, my bad
try with a much larger number of sos tokens, say 16 or 32

@MarcusLoppe ah, you aren't referring to the number of sos tokens, but to the token number in the main sequence, my bad
try with a much larger number of sos tokens, say 16 or 32

I don't have the figures for them but I tried 16 and got bad results.
As you can see using 8 tokens had the worst results.

I know that setting up the sos tokens before the decoder and then inserting after the cross attention will create some sort of learnable relationship and I assume that the tokens change with loss.
However I don't have any data to back this up but isn't it better to have the tokens be a representation of the text embeddings?
If the sequence is 48 tokens the majority of the loss comes after the frist few tokens and will 'shape'/optimize to minimize that loss, meaning that the tokens will adapt to fit itself to work for 98% of the sequence.

ok, I'll try one more thing, but if that doesn't work, let's go for your text prefix solution

ok, I'll try one more thing, but if that doesn't work, let's go for your text prefix solution

Little bit off topic but I trained a 1 quantize auto-encoder and transformer and good results. It was a little slower progression but I got about 0.03 loss with the transformer.
I didn't succeed in generating mesh with 0 tokens but providing 10 tokens it managed to generate mesh :)
So that is a big win, halfing the sequence length and reducing vram requirement from 22 GB to 8 GB in training (800 faces)

ok, I'll try one more thing, but if that doesn't work, let's go for your text prefix solution

Hi again.
Here is some failed results:

I've tried training with a higher loss at the first token  or even only applying loss for the first token.
I did some testing with text embeddings which I used the text_embeds to append at start or use a linear layer(dim, dim * num_tokens) and then rearranged to (b,num_tokens, dim)
Replaced the sos_tokens with text_embeds
Tested using 32 tokens

I was wonder if even the decoder cross-attention layer could handle it alone but with just the decoder layer couldn't handle any part of the sequence.
So what thinking with the cross-attention? Do you think the sos token or cross-attention can handle the cold start?
Since the issue is with the first 0-3 tokens, would it beneficial to create some kind of embedding space that contains the first 3 tokens and is indexed by text embedding, this way the text embedding provided by the user can be used to find the nearest neighbour.
It's not very novel but a good way to at-least kickstart the generation, although the issue might be resolved with scale later on.
The best result I got was with the commit below, however It may just be luck and not a consistent behaviour. The linear attention method had similar results but without the slowness of adding cross-attention to the fine-decoder.
Training many many epochs using add cross attention based text conditioning for fine transformer too
Token 1: Correct = 260, Incorrect = 95
Token 2: Correct = 319, Incorrect = 36
Token 3: Correct = 351, Incorrect = 4
Token 4: Correct = 355, Incorrect = 0
Linear layer with 4 sos tokens
if not exists(cache):
            sos_tokens, attended_face_codes = unpack(attended_face_codes, packed_sos_shape, 'b * d')
            attention_scores = F.softmax(self.attention_weights(sos_tokens), dim=1)
            pooled_sos_token = torch.sum(attention_scores * sos_tokens, dim=1, keepdim=True)
            attended_face_codes = torch.cat((pooled_sos_token, attended_face_codes), dim = 1)

Token 1: Correct = 237, Incorrect = 118
Token 2: Correct = 205, Incorrect = 150
Token 3: Correct = 351, Incorrect = 4
Token 4: Correct = 354, Incorrect = 1
Token 5: Correct = 355, Incorrect = 0

@MarcusLoppe thank you Marcus! 🙏 will get a few solutions built
i also realized i wasn't caching the cross attention key / values correctly 🤦 will get that fixed this morning

@MarcusLoppe thank you Marcus! 🙏 will get a few solutions in soon
i also realized i wasn't caching the cross attention key / values correctly 🤦 will also get that fixed this morning

Awesome! :smile:
Outside of meshgpt have you had success training the decoder and let it generate from cold start with just a embedding before? E.g. train on sequences with 6 tokens and the only input is a embedding that is used in the cross attention for the decoder.
It works kinda good when the dataset is small (<500) , I don't think it's the model size since it can remember 10k models if its prompted with a few tokens.
Btw let me know if I'm doing something wrong but during my testing I just call forward_on_codes and get the logits and get the token by argmax.
I'm not sure if this would disable the classifier guidance or not.

@MarcusLoppe thank you Marcus! 🙏 will get a few solutions in soon
i also realized i wasn't caching the cross attention key / values correctly 🤦 will also get that fixed this morning

Hey again,
So I've noticed some strange behaviour with the cross attention num_mem_kv that might help you resolve the issue.
I've previously changed the value before without any noticeable changes.
However using the commit with the fine-decoder cross-attention I found the results below.
Setting the num_mem_kv cross attention to 16 seems to be hitting some kind of sweet spot (maybe related to the dataset size).
This made it possible to generate mesh from token 0 since it seems to be hitting the correct tokens, however as you can see the mesh is hardly smooth but at least it's selecting the correct first token! I'm currently training to see if using x5 augmentation of the same dataset will yield any better results since it might be more robust.

I also tested fine depth either to 4 or 8 but the effect worsen the performance, same goes with increasing the attn_num_mem_kv to 16.
Commit: https://github.com/lucidrains/meshgpt-pytorch/commit/5ef6cbfeaa3c43b67c548d1b11e033069b01f590
8 cross_attn_num_mem_kv
Token 1: Correct = 6, Incorrect = 349
Token 2: Correct = 165, Incorrect = 190
Token 3: Correct = 320, Incorrect = 35
Token 4: Correct = 322, Incorrect = 33
Token 5: Correct = 341, Incorrect = 14

16 cross_attn_num_mem_kv

Token 1: Correct = 293, Incorrect = 62
Token 2: Correct = 331, Incorrect = 24
Token 3: Correct = 354, Incorrect = 1
Token 4: Correct = 354, Incorrect = 1
Token 5: Correct = 355, Incorrect = 0

16 cross_attn_num_mem_kv
8 fine_attn_depth
Token 1: Correct = 233, Incorrect = 122
Token 2: Correct = 189, Incorrect = 166
Token 3: Correct = 321, Incorrect = 34
Token 4: Correct = 313, Incorrect = 42
Token 5: Correct = 342, Incorrect = 13

32 cross_attn_num_mem_kv

Token 1: Correct = 4, Incorrect = 351
Token 2: Correct = 207, Incorrect = 148
Token 3: Correct = 345, Incorrect = 10
Token 4: Correct = 338, Incorrect = 17
Token 5: Correct = 349, Incorrect = 6

16 attn_num_mem_kv
16 cross_attn_num_mem_kv
Token 1: Correct = 5, Incorrect = 350
Token 2: Correct = 205, Incorrect = 150
Token 3: Correct = 353, Incorrect = 2
Token 4: Correct = 355, Incorrect = 0
Token 5: Correct = 355, Incorrect = 0

@MarcusLoppe thank you Marcus! 🙏 will get a few solutions in soon
i also realized i wasn't caching the cross attention key / values correctly 🤦 will also get that fixed this morning

Hey,
I think I've figured something out, I quite a lot changes but I had success by applying the following:

Text embedding pooling with to_sos_text_cond
sos_token (single parameter).
Fine decoder cross-attention

Plus a few other tricks.
The training is also quite specific in regards to masking the text and other factors, if it becomes overtrained then the results are just blobs again.
When the conditions are pretty good the model will always generate a complete shape, I think this was in part of the text embedding mask drop probability .
Btw I also manage to train a model using 1 quantizer which reduced the inference time by half (duh :) ).
I wouldn't say this issue is resolved since using a dataset with 1k unique labels, during the generation it will steer towards the most average mesh model according the the text embeddings (cond scale helps sometimes, setting it too high will turn the mesh into a blob).

Possible issue / accidental feature
I'm not sure if it's a problem but since I add the sos_token before the main decoder and then adding the text embedding pooling afterwards, it will results in 2 tokens with 'value' is added and with the padding it will be 12 tokens.
The first 6 extra tokens are due for the autoregressive and the other 6 is due to the text embedding pool since it's added just before pad_to_length is called.
The results is that 1 token will be replaced/lost due to the right shift since the 2 tokens are added and only the sos_token is removed.
So the data between the decoder and fine decoder will be shifted right and the becomes in another order, this might not be a issue for the fine decoder since it's already out of order due to the rearranging and adding the grouped_codes so the shape goes from (b, faces, dim)  to (b * (faces+1),  (quantizers * vertices_per_face), dim)
But if you think of in a linear fashion and ignoring the ML transforming the data, the output would be:
<pooled_text_embed> <mesh> <cut> <EOS> <extra tokens>
Instead of:
<mesh> <EOS> <cut> <extra tokens>
This is just a guess but maybe since the output is over a longer sequence window during (12 tokens in the future instead of 6), it might help with the inference since during training it outputs what it thinks might be after the EOS token. However this output is cut off and doesn't affect the loss so I'm not sure if it matters, I also increased the padding so it's 18 tokens but the performance degraded).
I also tested replacing the pooled_text_embed with a Parameter dim but it got worse results so the text embedding does affect the output.
Multi-token prediction
I've been trying to understand how the transformer train and at the end there is always 1 extra face (6 tokens) and then the sequence is cut of so it's 5 tokens remaining. I'm guessing this is done for the autoregression and the EOS token.
But I think it can provide a additional effect by extending 'hidden' future tokens and can be used multi-token prediction.
I'm not sure about where the masking is applied while training but as a test I increase the amount of codes that was cut off and set 'append_eos' to false to see if it can predict multiple tokens ahead.
Nothing fancy as the meta paper and just a weak proof of concept.
Here is some samples after training 15 epochs on the first 12 tokens on 2.8k meshes with 1000 labels:
1 tokens: 0.3990 loss (0.5574 loss without the text embedding pooling)
2 tokens:  0.112 loss
3 tokens: 0.24 loss
4 tokens: 0.1375 loss (woah!)
6 tokens: 0.1826  loss (18th epoch 0.104 loss)
if return_loss:
            assert seq_len > 0
            codes, labels = codes[:, :-number_of_tokens], codes
.......
embed = embed[:, :(code_len + number_of_tokens)]

500 labels with 10 models for each label- 2k codebook, number of quantizers: 2

1000 labels with 5 models for each label- 2k codebook, number of quantizers: 2

100 labels with 25 models for each label- 16k codebook, number of quantizers: 1

@MarcusLoppe thanks Marcus for the detailed report and glad to hear you found a solution!
i'll keep chipping away at it to strengthen conditioning
next up is to probably add adaptive layer/rms normalization to x-transformers

@MarcusLoppe you should see a slight speed bump on inference now, as i now cache the key / values correctly for cross attention
hope i didn't break anything!

@MarcusLoppe thanks Marcus for the detailed report and glad to hear you found a solution!
i'll keep chipping away at it to strengthen conditioning
next up is to probably add adaptive layer/rms normalization to x-transformers

Lovely :) I'll test the FILM normalization method and let you know.
However the sos_token isn't quite how I implemented it, I've had more success in just leaving the sos_token in without unpacking it.
I had best success with using the sos_token as per your commit move the concatenation of the sos token so it is always conditioned b.
That commit have had far better results rather then:

Unpacking multiple tokens + pooling
Unpacking single
Unpacking multiple tokens and taking last token.

I tried explaining it before with my tests but I might have not been clear enough.
Here is the implementation I've used
https://github.com/MarcusLoppe/meshgpt-pytorch/blob/sos_token_test2/meshgpt_pytorch/meshgpt_pytorch.py

@MarcusLoppe you should see a slight speed bump on inference now, as i now cache the key / values correctly for cross attention
hope i didn't break anything!

I'll give it a go :)
Btw I can create a pull request for this but when using 1 quantizer, the rounding down method doesn't work in generation. Currently it's doing:
10 codes / 1 = 10 * 1 = 10 codes.
Instead of doing:
10 codes / 3 = 3 * 3 = 9 codes.
So changing the below will made the 1 quantizer generation work.
From:
 round_down_code_len = code_len // self.num_quantizers * self.num_quantizers
To:
 round_down_code_len = code_len // self.num_vertices_per_face * self.num_vertices_per_face

@MarcusLoppe thanks Marcus for the detailed report and glad to hear you found a solution!
i'll keep chipping away at it to strengthen conditioning
next up is to probably add adaptive layer/rms normalization to x-transformers

Lovely :) I'll test the FILM normalization method and let you know. I tried replacing the the PixelNorm using the film batch normalization on the ResNet but I had mild success, the std for the first token and it's relationship to the label decreased from 12 to 11.
However the sos_token isn't quite how I implemented it, I've had more success in just leaving the sos_token in without unpacking it. I had best success with using the sos_token as per your commit move the concatenation of the sos token so it is always conditioned b. That commit have had far better results rather then:

Unpacking multiple tokens + packing pooling
Repacking single
Unpacking multiple tokens and packing last token.

I tried explaining it before with my tests but I might have not been clear enough.
Here is the implementation I've used https://github.com/MarcusLoppe/meshgpt-pytorch/blob/sos_token_test2/meshgpt_pytorch/meshgpt_pytorch.py

@MarcusLoppe you should see a slight speed bump on inference now, as i now cache the key / values correctly for cross attention
hope i didn't break anything!

I'll give it a go :) Btw I can create a pull request for this but when using 1 quantizer, the rounding down method doesn't work in generation. Currently it's doing: 10 codes / 1 = 10 * 1 = 10 codes. Instead of doing: 10 codes / 3 = 3 * 3 = 9 codes.
So changing the below will made the 1 quantizer generation work. From:  round_down_code_len = code_len // self.num_quantizers * self.num_quantizers To:  round_down_code_len = code_len // self.num_vertices_per_face * self.num_vertices_per_face

thanks for reporting the rounding down issue!
and yes, i can cleanup the multiple sos tokens code if not needed. however, by setting just 1 sos token, it should be equivalent to what you deem the best working commit

thanks for reporting the rounding down issue!
and yes, i can cleanup the multiple sos tokens code if not needed. however, by setting just 1 sos token, it should be equivalent to what you deem the best working commit

Just tested it on the first 12 tokens and using the FiLM + mean have worse performance plus it's giving me nan loss.
However it might work better when applied to the full sequence, I'll get back to you.
Although I'm not sure if it would help since the issue might be pooling the mean. Lets say 1000's of text embeddings which all are unique, the cross-attention will receive them in their original state but then the fine decoder will get the average of each embedding as a additional token.
After averaging the embeddings they are now closer to each other then before and some of them no longer unique.
I think this is the reason why the same model is the 'default' for several mesh models.

@MarcusLoppe thanks for running it, made a few changes
yea, can definitely try attention pooling, which is a step up from mean pool

@MarcusLoppe thanks for running it, made a few changes
yea, can definitely try attention pooling, which is a step up from mean pool

Okay, some updates.

I noticed that the masked_mean was broken since classifier free guidance uses the pad id "0" instead of "-1", so the embeddings never stayed the same for each batch since it included the padded values when doing the mean.
This would mean that the 'chair' embedding would have different values and effectively be random.
I created a pull request to add the padding id: Added padding id option

After the padding issue was resolved I still had meshes with text that was more popular then other (e.g. it matched with "pallet" for 183 times of 775). So I printed out the cosine similarities and noticed a pattern, 'chair' and 'pallet' had 0.99999 cosine similarity and 'pallet' had 0.99999 similarity with many others. I was using CLIP so I switched to T5/BGE and the similarity was around 0.69 as it should be.
I tried to combined CLIP & T5 using model_types = ('t5', 'clip'),  however the same issue remained.

CLIP seems to work better then T5 & BGE on longer sentences and contain more nuanced information.
Here is the cosine similarities (checkout the last 2):
['pallet', 'chair']
BGE 58.8942
T5 67.7801
CLIP 99.9937
['a pallet', 'a chair']
BGE 71.565
T5 60.0675
CLIP 81.1785
['a pallet on floor', 'a chair on floor']
BGE 81.9622
T5 40.6449
CLIP 76.7676
['pallet', 'pallet on floor']
BGE 89.8585
T5 50.7333
CLIP 78.1393
['chair', 'pallet on floor']
BGE 60.5253
T5 37.083
CLIP 78.2081

So after fixing these changes I tried again and had much better success :)
I tested FiLM and got mixed results, I'm not confident to say what is best since the 1.5k tokens tests says it's best with FiLM on but the training without FiLM is better.
The results are very good, however there is some issues such as the test using x5 models per label, I have a very had time to generate 3 sets of distinct rows of the same furniture labels.
It does follow the label but it seems to be ignoring the other models (even with cond_scale and high temperature 0.8).
I trained on a dataset using 775 labels with 5x examples each (3.8k meshes), first tests was only trained on 60 tokens total, then the latest one I trained on the full 1500 token sequences. I tested using x10 examples but that training run requires more time to get a accurate picture of it's performance.
For calculating the accuracy I took all the unique labels and created list of all the models that have the same label. Using this list I checked if any of these models contains the same 3 first tokens as the generated sequence, if so. I count it as "correct".
Using FiLM
T5, trained on 60 tokens:
Generation accuracy:
Accuracy: 0.9987096774193548 all_correct: 774 len(test_dataset): 775
Token 1: Correct = 774, Incorrect = 1
Token 2: Correct = 774, Incorrect = 1
Token 3: Correct = 774, Incorrect = 1

Forward accuracy:
Accuracy: 0.27225806451612905 all_correct: 211 len(test_dataset): 775
Token 1: Correct = 774, Incorrect = 1
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

BGE, trained on 60 tokens:
Generation accuracy:
Accuracy: 1.0 all_correct: 775 len(test_dataset): 775
Token 1: Correct = 775, Incorrect = 0
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

Forward accuracy:
Accuracy: 0.36 all_correct: 279 len(test_dataset): 775
Token 1: Correct = 775, Incorrect = 0
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

BGE trained on 1500 tokens:
Generation accuracy:
Accuracy: 0.984516129032258 all_correct: 763 len(test_dataset): 775
Token 1: Correct = 763, Incorrect = 12
Token 2: Correct = 763, Incorrect = 12
Token 3: Correct = 763, Incorrect = 12

Generation - Super loose (cosine similarity with text 90%)
Accuracy: 0.9922580645161291 all_correct: 769 len(test_dataset): 775
Token 1: Correct = 770, Incorrect = 5
Token 2: Correct = 769, Incorrect = 6
Token 3: Correct = 769, Incorrect = 6

Forward accuracy:
Accuracy: 0.28774193548387095 all_correct: 223 len(test_dataset): 775
Token 1: Correct = 760, Incorrect = 15
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

Without FiLM
T5, trained on 60 tokens:
Generation accuracy:
Accuracy: 0.9987096774193548 all_correct: 774 len(test_dataset): 775
Token 1: Correct = 774, Incorrect = 1
Token 2: Correct = 774, Incorrect = 1
Token 3: Correct = 774, Incorrect = 1

Forward accuracy:
Accuracy: 0.34580645161290324 all_correct: 268 len(test_dataset): 775
Token 1: Correct = 774, Incorrect = 1
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

BGE, trained on 60 tokens:
Generation accuracy:
Accuracy: 1.0 all_correct: 775 len(test_dataset): 775
Token 1: Correct = 775, Incorrect = 0
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

Forward accuracy:
Accuracy: 0.33419354838709675 all_correct: 259 len(test_dataset): 775
Token 1: Correct = 775, Incorrect = 0
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

BGE trained on 1500 tokens:
Generation accuracy:
Accuracy: 0.9780645161290322 all_correct: 758 len(test_dataset): 775
Token 1: Correct = 758, Incorrect = 17
Token 2: Correct = 758, Incorrect = 17
Token 3: Correct = 758, Incorrect = 17

Generation - Super loose (cosine similarity with text 90%)
Accuracy: 0.9883870967741936 all_correct: 766 len(test_dataset): 775
Token 1: Correct = 766, Incorrect = 9
Token 2: Correct = 766, Incorrect = 9
Token 3: Correct = 766, Incorrect = 9

Forward accuracy:
Accuracy: 0.28774193548387095 all_correct: 223 len(test_dataset): 775
Token 1: Correct = 746, Incorrect = 29
Token 2: Correct = 775, Incorrect = 0
Token 3: Correct = 775, Incorrect = 0

775 labels with 10x examples each (7.7k meshes),
BGE trained on 1500 tokens:
Generation accuracy:
Accuracy: 0.9858064516129033 all_correct: 764 len(test_dataset): 775
Token 1: Correct = 764, Incorrect = 11
Token 2: Correct = 764, Incorrect = 11
Token 3: Correct = 764, Incorrect = 11

Generation - Super loose (cosine similarity with text 90%)
Accuracy: 0.9896774193548387 all_correct: 767 len(test_dataset): 775
Token 1: Correct = 767, Incorrect = 8
Token 2: Correct = 767, Incorrect = 8
Token 3: Correct = 767, Incorrect = 8
Token 4: Correct = 767, Incorrect = 8

Renders:
Mesh files: https://file.io/OxWCcTYpUbxN
Without FILM
['bed', 'sofa', 'monitor', 'bench', 'chair', 'table', 'console table console', 'object on a stick', 'knife', 'billboard', 'concrete structure', 'rod', 'stick with a handle', 'shark fin', 'wooden railing', 'zigzag chair straight chair side chair', 'building', 'building with a few windows', 'wooden bench', 'screen with nothing on it', 'bird with a beak', 'apple', 'trash can with a lid', 'blocky robot', 'crystal on a base', 'sign with arrows on it', 'three different colocubes', 'crowbar', 'sheet of paper', 'metal rod', 'computer screen computer display screen crt screen', 'octagon', 'chair on a floor', 'platform bed', 'dark object', 'u shaped object', 'bed with a headboard', 'three blocks', 'brush', 'whale tail', 'staircase', 'lamp', 'broken cylinder', 'night stand', 'traffic cone', 'drill', 'four geometric shapes', 'trash can', 'rocket ship', 'traffic cone on a base', 'pyramid and a square', 'robot that is standing up', 'computer monitor', 'pixelated object', 'coffee cup', 'chaise longue chaise daybed chair', 'three rocks', 'desk table-tennis table ping-pong table pingpong table', 'letter k', 'box with a ribbon', 'dice with dots on it']

With FILM
['bed', 'sofa', 'monitor', 'bench', 'chair', 'table', 'block animal', 'car', 'book', 'minecraft character in a shirt', 'pot', 'hanging sign', 'minecraft character wearing a shirt', 'secretary writing table escritoire secretaire', 'apple with a stem', 'two colorful blocks', 'line', 'security camera', 'pan', 'armchair', 'picket fence', 'palm tree', 'the letter t', 'bottle', 'park bench bench', 'sign', 'wooden baseball bat', 'wooden table', 'container with a lid', 'picnic table with two benches', 'geometric tree', 'operating table', 'traffic light', 'checkechair', 'dumpster', 'group of cubes', 'chair on a floor', 'two rectangular objects', 'box sitting', 'blocky chicken with an beak', 'octagon', 'couch with arm rests', 'metal object', 'top hat', 'diamond shaped object', 'two shelves', 'two rocks', 'apple', 'cartoon snail carrying a box', 'bench', 'cylinder and a cube', 'minecraft dolphin', 'question mark', 'tree made out of blocks', 'display video display', 'wooden stool', 'box with stripes on it', 'metal rod', 'tree stump', 'three dimensional object', 'side table table']

@MarcusLoppe awesome, i think after adding adaptive layernorms to x-transformers, we can close this issue
that will surely be enough

@MarcusLoppe awesome, i think after adding adaptive layernorms to x-transformers, we can close this issue
that will surely be enough

A little question, I'm about to train bit larger model that would require many text embeddings and I'm bit worried that cross-attention with the text embedding might 'take up' to much of the model.
If we didn't use cross-attention with text then it could cross-attend the sequence itself and make it more efficient and simpler.
I was wondering if using something like below would work?
The multiple sos tokens are just kept for the main decoder but isn't for the rest of the network and there is no Q-Former architecture that takes the text embeddings and encodes the information to it.
https://arxiv.org/pdf/2405.20853

@MarcusLoppe oh, i don't even know what the q-former architecture is haha
i'll have to read it later this week, but it sounds like just a cross attention based recompression, similar to perceiver resampler
just got the adaptive layernorm conditioning into the repo! i think we can safely close this issue

@MarcusLoppe we can chat about q-former in the discussions tab

@MarcusLoppe oh yes, the qformer architecture is in vogue. bytedance recently used it for their vqvae to compress images even further.
will explore this in the coming month for sure!

@MarcusLoppe is he/she a phd or ms student? if so, you and him/her should be able to work together and implement it, could even make for a short paper
or i can take a look at it, but probably not for another month or two

I think he's a PHD student, he applied for the compute a while ago and was granted it. It's not for a thesis or graded paper but perhaps a technical report.
I'm happily and interested it in implementing it myself but with many of SOTA things it might be above my head.
As far as I understand it, the image patches (image / 32) in processed through a encoder which then are encoded & quantized into a codebook. Then these codes can be used by the transformer as token indices or maybe just the encoded dim output from the quantizer.
I'm on the right track?

@MarcusLoppe ok, if he's a phd student, you two should definitely be able to work it out from the code already available

@MarcusLoppe i'm not sure without spending a day reading the paper, but it looks to me they are simply using appended "query" tokens, which is similar to memory / register tokens in the literature. they simply concat it to the sequence and then attend to everything, and slice it out

@MarcusLoppe ask your collaborator! he should know if he is in the field

@MarcusLoppe i'm not sure without spending a day reading the paper, but it looks to me they are simply using appended "query" tokens, which is similar to memory / register tokens in the literature. they simply concat it to the sequence and then attend to everything, and slice it out. it is similar to the sos tokens we've been playing around with, except it isn't autoregressive

I've read bit further, you might be right and I'm not understanding your terminology.
My understanding it that they train a autoencoder (tokenizer) and only use 32 tokens to represent the image.
They make extract patches for the image and represent them in token(s) and the during generation they can mask certain tokens and generate new novel images (?).

I'm not quite sure if it's applicable to this project, I played bit around with using the sos tokens,however I got worse results.
I used a encoder layer that uses the text embeddings as cross-attention to output the dim for the sos tokens.
I also tried using [sos_tokens , text_embedding] and encoded it and returned the output from the encoder [:32]
I was thinking that maybe the issue isn't that the text embeddings are too weak but maybe the cross-attention will messes it up a bit.
Since the cross-attention to the text embeddings isn't one to one, it might be unstable since it will learn that one text embedding have 100's of different 'correct solutions'.
I think it will be more stable if the text is within the token sequence, the sos tokens hasn't quite worked out.

@lucidrains
Btw congrats seems like many people have used your implementation of autoencoder, here is one that is basically a largely copy and paste :)
https://github.com/whaohan/pivotmesh/tree/master
https://github.com/whaohan/pivotmesh/blob/master/model/pivotmesh.py
https://github.com/whaohan/pivotmesh/blob/master/model/meshAE.py

@MarcusLoppe haha no, thank you! honestly, this project would not have gotten far without your feedback
now it seems like we are on track to give mesh's the image / audio / video treatment

@MarcusLoppe you should def chat with your collaborator (instead of me) since you'll be training the next model together


[stable/mssql-linux] Run SQL queries during the bootup in "mssql-linux" chart

Is your feature request related to a problem? Please describe.
MySQL and Postgres has the option to run SQL queries during the bootup using initializationFiles (MySQL) and configurationConfigMap (Postgres). The Helm chart for mssql-linux does not have this option.
Describe the solution you'd like
Allow users to run SQL queries during the bootup using a config map in the values.yaml for mssql-linux chart.

@ctienshi +1 for this feature. It is a basic use case of any DBMS based Helm Chart, AFAIU.

It would be great if this feature can be added.

Hi @VimukthiPerera
I'm afraid I'm not one of the maintainers of the mssql-linux chart.
Please also update the title of the issue so it states [stable/mssql-linux] so the maintainers of the chart can easily identify it.

Thanks @juan131. Changed the title.

@thomasliddledba we still cannot see the discussed feature in the MSSQL Helm chart.
This is an essential feature when it comes to Helm based deployments of database servers. Is this part of the future road map for this official chart?

@chirangaalwis - Thanks for pointing this out.  I believe because of the title not being correct and issue not assigned to me, I never saw this feature request.  Wow, this is old (based on the opened date).
I agree, this would be a great feature and something that can be added, however, with the changes to this repository I hope to get it in.

/assign @thomasliddledba

/reopen

@thomasliddledba thanks a bunch. This https://github.com/helm/charts/issues/19694 seems like a similar issue, too.

@thomasliddledba any update on this? Is it possible to let us know when this feature would be available?


Unzip for seq.

The problem with unzip for seqs as in many other seq functions is the decision to make it strict which would not work for infinite sequences or make it lazy and allow to iterete twice the sequences.
It worth exploring a lazy implementation which caches the iteration as it goes.

The lazy implementation would look like:
let unzip x =
    let c = Seq.cache x
    Seq.map fst c, Seq.map snd c

The resulting sequence will be always cached, even if the first resulting sequence is iterated twice, it will traverse the sequence only once.
This might be undesirable in some cases.
The other alternative is to allow to traverse the sequence many times. Although this alternative is only suitable for restartable sequences, has the advantage that is always possible to transform in the first alternative just by calling Seq.cache.
The same logic applies for existing functions in the core library, like Seq.tail.
let s = Seq.initInfinite (fun i -> i, i)
let unzip x =
    Seq.map fst x, Seq.map snd x

let unzipped = unzip s
let cachedUnzipped = s |> Seq.cache |> unzip

It worths noting that both results will work with infinite sequences:
let x = fst unzipped |> Seq.take 10 |> Seq.toList
let y = fst cachedUnzipped |> Seq.take 10 |> Seq.toList


feat: docs(HackWasm2023, DOSI Vault)

Please update the offline feedback about dosi-vault.

We decided to keep this content for HackWasm


docs(logout): flags are wrongly listed in link command page

Description

In Turborepo's reference page for the link command, the logout command flags are listed.
I just moved those flags to the right page.

Testing Instructions

Check the updated docs

This option does exist on turbo link but it looks like the copy describing it is wrong.
Could you change on the link page:
Specifies the URL to logout of your Remote Cache provider.

to
Specifies the URL of your Remote Cache provider.

You're absolutely right.
I fixed that in 6e5e9b4 (#8830)


Missing image under "restricting the audience" and then "Manual entry for restricted audience"

image is missing in the "restricting the audience" section and then under "Manual entry for restricted audience"

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 021daed7-396f-aac2-a359-bbde9a5ad381
Version Independent ID: 669caf25-6b81-61ac-3952-7f25ff66592f
Content: Private SKUs
Content Source: articles/marketplace/cloud-partner-portal-orig/cloud-partner-portal-azure-private-skus.md
Service: marketplace
GitHub Login: @dan-wesley
Microsoft Alias: pbutlerm

@rstorgaard Thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.

Images were added but this issue was not subsequently closed.

#please-close


Addon Zookeeper-operator

Description of your changes
Adds a new addon Zookeeper operator which is one of the addons mentioned in the issue https://github.com/kubevela/kubevela/issues/5358

How has this code been tested?

Checklist

I have:

[x] Title of the PR starts with type (e.g. [Addon] , [example] or [Doc]).
[x] Updated/Added any relevant documentation and examples.
[x] New addon should be put in experimental.
[x] Update addon should modify the version in metadata.yaml to generate a new version.

Verified Addon promotion rules
If this pr wants to promote an experimental addon to verified, you must check whether meet these conditions too:

[ ] This addon must be tested by addon's e2e-test to guarantee this addon can be enabled successfully.
This addon must have some basic but necessary information.

[ ] An accessible icon url and source url defined in addon's metadata.yaml.
[ ] A detail introduction include a basic example about how to use and what's the benefit of this addon in README.md.
[ ] Also provide an introduction in KubeVela documentation.
[ ] It's more likely to be accepted if useful examples provided in example dir.

@wonderflow @wangyikewxgm According to me this addon is done and works fine. Please review it and let me know if I have to change something.


Run ordering test for all parquet engines

[x] Tests added / passed
[x] Passes flake8 dask
[ ] Fully documented, including docs/source/changelog.rst for all changes
and one of the docs/source/*-api.rst files for new API

Thanks @xhochy.


Add fix for store that gets encoded multiple time

If you have different version of coveoua included in a single page, it seems that older version will encode values differently than newer version, so we can end up with a string when the getItem functionality was called on the store.
And then all kind of random stuff would start to break.
This tries to add some logic to Parse until we get back a valid object if possible, with a bail if everything is fubar.

I saw the problem arise while we are in the process of delivering MVP release for In Product. We include a newer version of coveoua on load of the In Product button to log a page view.
Then, when you open the popup and the JSUI is loaded, we get a "different" older version that is included directly in the JSUI source file, which is version 0.7.4.
And the local storage gets fubar when that happens.

After more investigation, the actual problem I saw was that for a particular client, they override the global JSON.stringify function with their own "custom" one which has a flawed implementation which double encodes stuff it should not.
I'll re-open a new PR with another approach to fix this problem.


Fix typo: Databricks instead of DataBricks

@liancheng : Thanks for your contribution! The author, @, has been notified to review your proposed change.

@twooley - Would you review the proposed changes? Thanks.

@ktoliver Looks okay to me. Thanks.


[FR] Send password reset email function

Is your feature request related to a problem? Please describe.
Via firebase_admin_auth I'm able to create and manage users. When I want to generate a password reset email through the default Firebase functionality (Firebase sends the email), I'm not able to do this through the Admin SDK, as only generate_password_reset_link is supported. I have to resort to sending a REST API call instead.
Describe the solution you'd like
Support a send_password_reset_email function that sends an email via Firebase to reset her password, similar to the Node.js client.
Describe alternatives you've considered
Sending a REST API call through HTTP.

@hiranya911 I'd like to work on this feature request!

Thank you @bverhoeve and @santhoshivan23. The Admin SDK (including the Node.js SDK) does not support sending emails. You will have to generate the email links and use your own or a third party SMTP sever to send the email.
We have a similar request for Node.js SDK https://github.com/firebase/firebase-admin-node/issues/46 however, the backend APIs currently do not support sending emails and adding backend support is also not that straightforward.

@lahirumaramba, My bad, the function I'm referring to in the issue is the sendPasswordResetEmail in the JavaScript client. How come this is not available in the Node.js client?

@ofer-pd We ended up implementing the API call ourselves. We have the same issue for MFA enrolment btw.


MIME4J-280 Wrapping the underlying exception rather then ignoring it.

Any reasons why pull request is not merged into master?

Sorry for the delay, it should have been merged earlier.
Thank you for reminding us.


add ChamelGang malware

I'll merge it as is and then open the corresponding issue to capture the actual analysis.


FUTURE_ORDER_TYPE_LIMIT_MAKER orders not possible?

Any clue why we can't place LIMIT_MAKER orders, but any other order?
resultb =client.futures_create_order(
symbol='BTCUSDT',
side=Client.SIDE_BUY,
positionSide = "LONG",
type= Client.FUTURE_ORDER_TYPE_LIMIT_MAKER,
quantity=0.01,
price = 25000,
timeInForce = 'GTC')
print(resultb)
binance.exceptions.BinanceAPIException: APIError(code=-1116): Invalid orderType.

LIMIT_MAKER is not used in futures order.  For post only orders, set timeInForce to GTX.

Thanks, but the function IS valid AND documented in Binance Python API for FUTURES. ?!

Anyway, post only seems to do the same. Thanks heaps :)

Not sure why we have FUTURE_ORDER_TYPE_LIMIT_MAKER = 'LIMIT_MAKER' in enums.py.
There is no mention of LIMIT_MAKER in either USD or COIN futures in the API Docs.


Improve docs

Hi there, nice work on the calendar! Just started to use it and found out issues with bootstrapping the component. I'm talking about setting localizers. In your Getting started section of demo app you suggest using BigCalendar.momentLocalizer(moment) format, on master Readme there's BigCalendar.setLocalizer(BigCalendar.momentLocalizer(moment)), and in the demo app there's third option introduced: localizer(globalize). Which one of them is correct? :) Can you make it aligned with the docs? Cheers & keep up the good work!
If you point a preferred way I can come up with an PR.

Hi! Either one is fine, both moment and gloablize are supported!

BigCalendar.setLocalizer(BigCalendar.momentLocalizer(moment)) doesn't work. The setLocalizer is not in type definition either. How can we use a custom localizer?

you use BigCalendar.setLocalizer(localizer) i'd read the source code for the the two localizers to see how to do it

I find it very useful when using some external APIs authors set one clean approach :) Just a suggestion to align it everywhere on docs.

@jquense What I understand from the code is that there is no type definition available that allow me to set a custom localizer (I use TypeScript). Am I wrong?
I can't agree more with @tpater .

@pellea I can't really speak to that, we don't maintain or control the type defs, they may be wrong on DT

Happy to take PRs for the docs y'all for stuff you think is unclear :)

+1 for improve docs. Will try and make a few PR's to make things a bit clearly that I found confusing at first! 👍


Raven align anchor2

Fixed bug and added features

output bed for the gap regions that do not get aligned (due to large size or invalid start/end)
output each alignment into bed
fixed bug in align package. The runlength of the last cigar was assumed to be 1, but should be calculated

Great to see these improvements and bug fix! There was one place where I was not sure about the logic. Should we add a test that includes something going into the "doNotCalculate" file?

Yes, just made gapSizeLimit customizable and added a test with non-empty doNotCalculate files


Specifying resource subtypes when converting graphdef to MLIR

System information

TensorFlow version (you are using): 2.7.0-dev20210629
Are you willing to contribute it (Yes/No): Yes (but may need some guidance).

Describe the feature and the current behavior/state.
The current tools that allow conversion of TensorFlow models to MLIR, do not seem to allow specifying the subtype for resource type tensors in the input arguments.
Consider the following snippet:
import tensorflow as tf
from tensorflow.python.pywrap_mlir import import_graphdef

SIZE = 3

class MyModel(tf.keras.Model):
    def build(self, input_shape):
        self.w = self.add_weight(shape=(SIZE,), trainable=True)

    def call(self, input):
        self.w.assign_add(input)
        return input

if __name__ == "__main__":
    model = MyModel()

    func = tf.function(model)
    concrete_func = func.get_concrete_function(
        tf.TensorSpec(shape=(SIZE,), dtype=tf.float32)
    )
    graph = concrete_func.graph

    mlir_tf = import_graphdef(
        graph.as_graph_def(add_shapes=True),
        "tf-standard-pipeline",
        False,
        input_names=[t.name for t in graph.inputs],
        input_data_types=["DT_FLOAT", "DT_RESOURCE"],
        input_data_shapes=[",".join(str(d) for d in t.shape) for t in graph.inputs],
        output_names=[t.name for t in graph.outputs],
    )
    print(mlir_tf)

    with open("model.mlir", "w") as f:
        f.write(mlir_tf)

which outputs the following MLIR:
module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 811 : i32}}  {
  func @main(%arg0: tensor<3xf32>, %arg1: tensor<!tf.resource>) -> tensor<3xf32> attributes {tf.entry_function = {control_outputs = "", inputs = "args_0:0,my_model/AssignAddVariableOp/resource:0", outputs = "Identity:0"}} {
    "tf.AssignAddVariableOp"(%arg1, %arg0) {device = ""} : (tensor<!tf.resource>, tensor<3xf32>) -> ()
    %0 = "tf.Identity"(%arg0) {device = ""} : (tensor<3xf32>) -> tensor<3xf32>
    return %0 : tensor<3xf32>
  }
}

Trying to lower this to hlo produces an error:
>>> tf-opt --tf-to-hlo-pipeline model.mlir -o out.mlir
model.mlir:2:3: error: expects resource type of argument 1 to have one subtype, got '!tf.resource'
  func @main(%arg0: tensor<3xf32>, %arg1: tensor<!tf.resource>) -> tensor<3xf32> attributes {tf.entry_function = {control_outputs = "", inputs = "args_0:0,my_model/AssignAddVariableOp/resource:0", outputs = "Identity:0"}} {
  ^
model.mlir:2:3: note: see current operation: "func"() ( {
^bb0(%arg0: tensor<3xf32>, %arg1: tensor<!tf.resource>):  // no predecessors
  %0 = "tf.ReadVariableOp"(%arg1) : (tensor<!tf.resource>) -> tensor<*xf32>
  %1 = "tf.AddV2"(%0, %arg0) : (tensor<*xf32>, tensor<3xf32>) -> tensor<*xf32>
  "tf.AssignVariableOp"(%arg1, %1) : (tensor<!tf.resource>, tensor<*xf32>) -> ()
  "std.return"(%arg0) : (tensor<3xf32>) -> ()
}) {sym_name = "main", tf.entry_function = {control_outputs = "", inputs = "args_0:0,my_model/AssignAddVariableOp/resource:0", outputs = "Identity:0"}, type = (tensor<3xf32>, tensor<!tf.resource>) -> tensor<3xf32>} : () -> ()

After manually modifying the type of %arg1 to tensor<!tf.resource<tensor<3xf32>>>, the conversion to hlo works as expected.
It would be nice if there was a way to directly specify subtypes for resources when using import_graphdef (or tf_mlir_translate with the --tf-input-arrays option).
Will this change the current api? How?
Yes. One idea is that the input_data_types argument of import_graphdef could accept subtypes for DT_RESOURCE with a syntax like this:
input_data_types=["DT_FLOAT", "DT_RESOURCE<tensor<3xf32>>"],

or like this
input_data_types=["DT_FLOAT", "DT_RESOURCE(3:DT_FLOAT)"],

or something similar.
tf_mlir_translate --tf-input-arrays could adopt the same syntax.
Who will benefit with this feature?
Anyone who wants to export models with resource inputs to MLIR (e.g. the graph of a single training step).
Any Other info.
Please let me know if there is a different method to emit the desired MLIR.

This seems like it would be a nice improvement indeed!

@laszlo-luminous,
I tried to execute the code on tensorflow v2.11 and it was executed without any error/issue. Kindly find the gist of it here and also the related PR's #55791 & https://github.com/parsabee/tensorflow/pull/1/files were also merged.
https://github.com/tensorflow/tensorflow/pull/55791/files
Thank you!

Closing this as stale. Please reopen if this is still a valid request. Thank you!


feat: decide whether two C strings are equal and support CHECK_STREQ* and CHECK_STRNE*

This PR is to resolve https://github.com/apache/incubator-pegasus/issues/1299.

How about to replace memcmp too?

OK, I think I can replace with a new function mequals that also process NULL pointers.


refactor byline category parsers

@arnasziedavicius tiny refactor of one of the parser methods, could you check this to see if it works with new talks content?

Good spot, that first line shouldn't be there! I can push a fix shortly...


GoogleWebAuthorizationBroker.AuthorizeAsync private method should be public

I could be wrong, but according to this example on using Oauth says that GoogleWebAuthorizationBroker.AuthorizeAsync should be able to accept a ClientSecrets object instead of a URI: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#installed-applications
Here: google-api-dotnet-client/Src/Support/GoogleApis.Auth.WP81/OAuth2/GoogleWebAuthorizationBroker.cs the method to support that is private, which breaks that example code.

Are you referring to this method: https://github.com/google/google-api-dotnet-client/blob/master/Src/Support/GoogleApis.Auth.WP81/OAuth2/GoogleWebAuthorizationBroker.cs#L79 ?
If so, then it does indeed look like an oversite, and should be public.

That is correct

Probably links to GoogleWebAuthorizationBroker.AuthorizeAsync doesn't take ClientSecrets in Google.APIs.Auth.OAuth2

After updating to the latest release of the nuget package I still seem to run into this issue, this is the code I'm using:
  public async Task authGoogleCloud()
        {
            UserCredential credential;
            using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
            {
                credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets, // error on this line
                    new[] { PredictionService.Scope.Prediction },
                    "user", CancellationToken.None);
            }

        }

AuthorizeAsync still seems to require a URI of the secret. I'm targetting UWP, which I realize isn't officially supported yet, but it still seems strange that the public method isn't accessible regardless.

Hmm... this is probably because there are four different implementations:

Dotnet4
WP
WP81
Windows

It looks like the last one at least still has the method as private...

I didn't check thoroughly enough last time - I hope they're all now done :)


proposal: github.com/golang/go/go/src/cmd/go

Go Workspace Commands
The new workspace features are great. I'd like to extend the capabilities of the go binary to use existing features across multiple modules in a workspace with convenience commands. There are two types of enhancements I wanted to propose:

running commands like go test or go mod tidy in every module of a workspace by extending the subcommands of go work
running a go get or similar command from a workspace root dir and applying that command to a module referenced in go.work

Go Work Test
go work test [build/test flags] [test pattern] [build/test flags & test binary flags]
go work test would compile and run each tests for all modules listed in go.work. I changed [packages] to [test pattern] in the command as go work test would already resolve explicitly to the workspace modules which packages' tests would be run. Build and test flags would be:

-exec xprog
-c
-args
-json output already supplies Package and could be extended to include the workspace path

Forgive me if this capability is already present. I could not figure out how to use the [packages] portion of go test and I'm still fuzzy on ./.... I'm currently using go list -f '{{.Dir}}' -m | xargs go test to run all workspace tests.
Go Work Tidy
go work tidy [-e] [-v] [-go=version] [-compat=version]
All existing flags would be applicable to running a go mod tidy across multiple modules at the same time. Execution and output could either be parallel and prepended by module or could be ran sequentially and categorized in the terminal with the module name.
I don't think it's confusing taxonomy jumbling go work tidy out of a command that runs a tidying operation on modules. It's a well known concept within the go community and it would be readily grasped as a command that performs a go mod tidy operation within the context of a workspace.
Here is an example of go mod tidy use that could more succinctly be performed with go work tidy.

I'm still not sure how it would be best to improve workspace workflows with go get. It would be nice to be able to perform go get within any module of a workspace without extra cd commands. From a directory containing a go.work file that uses ./module:

go get -m ./module github.com/get/package
go work get ./module github.com/get/package
go work mod ./module get github.com/get/package
go work get -m ./module github.com/get/package

Test shouldn't be special enough to break out of #50745
Tidy doesn't make sense as a workspace command until #50750 has some form of resolution.
The go get commands are equivalent to go get -C ./module example.com

It didn't seem like #50750 was wanting to perform go mod tidy as an isolated unit of work for each module of a workspace. I really couldn't understand the expectation from the issue.
The key part of proposing additional dedicated subcommands for go work is about accessibility. For example, there's no capital C in go help get and I'm not sure if that comment references an implemented or proposed feature. Discoverability of module or workspace work flows is exclusive to GH discussions (where I learned how to use go list and xargs to run tests).
Having access to these utilities and docs from go work adds discoverability for people new to the features and new to go in general who might not be familiar with the intricacies of go mod tidy and go get. I've personally used golang recreationally for a decade and only used go mod tidy for the first time this year.


Kadane's Algorithm in Java

Description
The file will contain the implementation of Kadane's algorithm in Java in O(n) time complexity.
Additional context
Important Checklist

[x] I have read the contribution guidelines before making this issue.
[x] I have verified this issue program is not already implemented
[x] I have not pushed this code anywhere else (even my repo)

Languages and Assignees:

[ ] Python: @
[x] Java: @prateekrai123
[ ] C: @
[ ] C++: @

@kaustubhgupta assign it to me.


Bazel recipe compile issue

Hi,
I'm trying to compile pycoral library which is using bazel build tool. I'm using python3-tflite from this layer also. When trying to build bazel-native recipe it fails in compilation phase. I also check and bazel is not used anywhere? I tried to use bazel-native 0.21 from mea-tensorflow but this one seems to be old. Thanks.

Bazel is not used. Not used to build tensorflow-lite.
It's because of the libedgetpu build, but the bazel build doesn't work.
I think it's best to download the release binaries.

I have libedgetpu from meta-coral where it works fine. BTW bazel 3.7.1 from meta-tensorflow can be build but I cannot compile pycoral (need to add custom yocto bazel toolchain similar as done for tensorflow package). Thanks.


🌐(all) add portugues translations

Purpose
One of our contributor helps us by translating all our content in portugues! 🇵🇹🙏
Proposal

[x] Download from crowding and compile this new translation


Description and keywords for SEO

Though most of the copy has been organised, we've overlooked the description and keywords for the site.
Do you guys have something prepared for this that I can pipe in (especially for the description which will appear in Google search results)?

Update: have started reading about this but would prefer to get guidance from @matthall8 before I fumble around in the dark! Will keep you posted @maxgerber

@rebeccaradding as far as I'm aware, the description is much more important than keywords (and search engines will pull out keywords from the description). Google will display about 150 characters for the site description so this might need very similar copy to the social media bios that were mentioned in another issue.

Hi @rebeccaradding,
Responded to your email but will also add a few things I mentioned here for transparency in true FAC style:

Meta keywords are no longer relevant and actually a sign of low quality, don't worry about them. (https://datadrivenlabs.io/blog/meta-keyword-tag-google-2018/)

Title tags are the most important meta data ranking factor. They should be no longer than 50-60 characters and each page should have it's own unique title tag. See https://moz.com/learn/seo/title-tag for more information.

Meta Descriptions do not directly influence SEO ranking however a well-written one can influence the click-through rate (CTR) of the page. I've provided some direct feedback on the FAC ones but key things to note are a) length as per @arrested-developer b) should be unique for each page and c) should include a call to action (CTA) like any well-written piece of ad copy.

@maxgerber draft meta-descriptions and title tags are the first page of this Google doc: https://docs.google.com/document/d/16aZha49xVtP7VtIVIntvHj0TUJFCKK05iQI3p1JSG5g/edit
Awaiting feedback from @matthall8 @sofer @freelancedad @yvonne-liu @iteles and any others with experience in this department!

@rebeccaradding - Emailed you a little bit of feedback.

Homepage:

Meta-description: Discover Founders and Coders, a tuition-free, peer-led coding bootcamp in London.
Title tag: Coding Bootcamp in London - Founders and Coders

What is Founders and Coders?

Meta-description: Find out about Founders and Coders, a cooperative community made up of developers from diverse backgrounds.
Title tag: About Us - Founders and Coders

Apply

Meta-description: Apply to our tuition-free, peer-led coding bootcamp for the most effective and least expensive route into the tech industry.
Title tag: Apply to our Course - Founders and Coders

Tech for Better

Meta-description: Discover our Tech for Better programme to design, test and build new digital service ideas using developers in London and Gaza.
Title tag: Tech For Better - Founders and Coders

Hire

Meta-description: Discover how to work with Founders and Coders to hire talented developers from diverse backgrounds.
Title tag: Hire Our Graduates - Founders and Coders

Stories

Meta-description: Read stories by and about our diverse community making a social impact with technology all over the world.
Title tag: Our Stories - Founders and Coders

@maxgerber do you need anything else?

@lucymk @ivanmauricio have you added the meta descriptions and title tags? I don't see an awaiting review label so I'm assuming no?

@rebeccaradding i've actually just added them in 😃

@lucymk how would I review this? Other than by Googling...but it appears Google hasn't picked up on the new stuff yet.

@rebeccaradding Yep only by Googling it in this instance. Normally you can check using 'View page source' and looking for the tags but this is not possible given the way the site has been built.

looks kind of bad here guys, anything is better than "sample" :)

I think this just hadn't been updated by google yet @emilyb7, if you look now it should be fine 😃

@lucymk @matthall8 do you know how we get Google to update this?

@rebeccaradding Google has picked up the new title tags. Sometimes, depending on the search term, Google will make small modifications to the title tag based on what it thinks is the best UX especially when it comes to the brand name (Founders and Coders in this case).

@lucymk I don't think that is from Google (@emilyb7 to confirm). I believe it is related to the open graph tags (https://www.redclayinteractive.com/what-are-open-graph-tags/) which dictates how a link is displayed when shared on platforms such as Facebook. I've inspected the page but there doesn't appear to be any there. Only thing I can see with 'sample' is the meta keywords:

hey @matthall8, @rebeccaradding, @lucymk
Sorry, my screenshot didn't come with much context. It was from a link I shared on my company Slack channel. Slack automatically generates a preview with some text.
I'm not sure how slack generates that preview text, and whether it's related to Google. I had presumed it was the meta description, and that that was missing. In any case, it seems to have sorted itself out in the meantime:

:)


Add support for reading back values of ON/OFF states

Hi, first off thank you for your library it is very useful.
While building something with it I realised it might be helpful to read back the current state of the ON/OFF states. So this PR adds this functionality to the library. I added a couple methods matching the setters and also added tests for them.
I do have pretty much no experience with the bitfiddly bits of rust programming though, so if anything needs improvement I'll gladly adjust the code :)

Sure, I'll rework/rewrite this PR once #13  is merged :)


Personal/change favicon

In a legitimate request to change the favcion to a more distinct one, I have added the one from the old version of the extension.
https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/197

Hi @KamilGadawski,
Please make sure to open a new issue / feature request before starting a new PR to make sure this will be accepted.
We want to differentiate from the original extension so I won't use the legacy favicon.


Add crates 'specs' and 'specs-derive' to support ECS

This revision includes:

Add crates 'specs' and 'specs-derive' to support ECS
Add simple test code to use crate 'specs'

You can ignore Codecov failure. Note that the code in lib.rs is just temporary code for testing crate specs.


Mcy94w/truncate appcmd

Thanks!!!
Chiyuan
From: Baris Caglar<EMAIL_ADDRESS>Sent: Friday, March 9, 2018 3:21 PM
To: Microsoft/IIS.ServiceMonitor<EMAIL_ADDRESS>Cc: Chiyuan Ma<EMAIL_ADDRESS>Review requested<EMAIL_ADDRESS>Subject: Re: [Microsoft/IIS.ServiceMonitor] Mcy94w/truncate appcmd (#27)
@bariscaglar approved this pull request.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FIIS.ServiceMonitor%2Fpull%2F27%23pullrequestreview-102819585&data=04|01|chiyma%40microsoft.com|5b83b5c352e340ff34b408d586147a74|72f988bf86f141af91ab2d7cd011db47|1|0|636562344870153418|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D|-2&sdata=k1Qfk6T8ZQSeGsyy6a3NdWr9NGrTzCgoVelSi6TImcg%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALzcIOlQdnAJHYO32kWYV2pSfBsR3UEaks5tcw5zgaJpZM4Sg-wL&data=04|01|chiyma%40microsoft.com|5b83b5c352e340ff34b408d586147a74|72f988bf86f141af91ab2d7cd011db47|1|0|636562344870153418|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D|-2&sdata=7zjpwy%2B5vgcH1ynn7B1vu70GXXfLoDXWJuvXjeH32D0%3D&reserved=0.


improve ui of team info page

assign this issue to me

Hi, i would love to work on this, kindly assign to me

@tanitoluwam  go for it

@tanitoluwam  any updates?

Hi, I was a bit occupied over the weekend, I will start working on it right away

I have made a pull request already, kindly review and give your feedback, thanks


features(core) add mac-build-ability

Great tool. Looks like we were thinking the same thing, making binaries for other env's. I've tried to merge my similar fixes with yours for being able to do it all on a mac.

Thanks!


pod install only get version 1.0.3

pod cache clear, pod repo update, pod update but still dont get the latest. also pod outdated command still dont show Fusuma.
ps - trying to get 1.0.4

this will do
pod 'Fusuma',:git => "https://github.com/ytakzk/Fusuma.git", :branch => 'master'

is something is wrong with the version number ?
im using Carthage and it gets 1.0.4 which can't be compiled and had to change to 1.0.3 which works.

@hfzwhd Can you try again? You will install 1.1.0 👌


add support for slicing w/o allocating and non-contiguous slices, to support slicing a Matrix

Note: this depends on CL 2 in min-cl: https://github.com/elftausend/min-cl/pull/2


Added and implemented delta time

Description
Major engine changes and reworks to allow for similar play on different devices. Movement and animations are now time-dependent using delta time as opposed to frame-dependent. This allows the game to run the same without need for locking frame rate with former sync() function or vsync. Fixed update was added which is updated 60 times per second regardless of frame rate.
Fixes and Changes
Timer.java:
Removed unused and redundant functions and variables. Added delta time to make calculations time dependent instead of frame dependent. Made functions static
Player.Java:
Removed redundant import
Changed variable speeds
Changed delta position directions
Added delta time in movement to make player movement time-dependent instead of frame-dependent
Animation.java:
Formatted file
Removed redundant and unused variables
Renamed variables and functions for readability
Fixed run() to use new delta time
GameEngine.java:
Removed redundant and unused variables
Frame unlocked update()
Added fixedUpdate()
Implemented delta time in fixed update
Removed sync() as it was redundant and overridden by glfwSwapInterval(1) Implemented delta time in FPS counter
GameObject.java:
Formatted variables
GameLogic.java:
Frame-unlocked update function
Game.java:
Changed update() to work with new changes.
Made camera follow player
Main.java:
Formatted GameEngine() arguments for readability
MapTree.java:
Small formatting
Type of change

[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] This change requires a documentation update

Checklist:

[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas

Possible Bugs and Errors
Animations, while called in fixedUpdate(), are slightly slower when vsync is enabled compared to when frame rate is unlocked. Movement does not appear to be effected by this bug and there does not appear to be any impact on game play.
Tests were conducted to ensure movement speed was the same among multiple frame rates. Further testing on separate devices is encouraged.

Changes were made. Happy thanksgiving!


Compiling for first time...

I just gave it a quick try at compiling ..
with updates
Here's my experience thus far:
cmake --workflow --preset="clang-release"
gave me an error "The CMAKE_CXX_COMPILER: clang++ is not a full path and was not found in the PATH."
I had to use
`cmake -G "Kate - Ninja" -D CMAKE_C_COMPILER="gcc" -D CMAKE_CXX_COMPILER="g++" --preset="clang-release"
which got me going to where I'm installing missing  dependencies:
qtwebengine5-dev
libkf5texteditor-dev
libkf5parts-dev
libboost-system-dev
libboost-thread-dev
kdevelop-dev

I also had to install chrpath
sudo apt install chrpath
as I was being told:

target requires changing an RPATH from the
build tree, but this is not supported with the Ninja generator unless on an
ELF-based or XCOFF-based platform.

I've edited this to clean it up a bit after trying again from scratch ( and corrected instead of working around the rpath error ).
next issue:
The "workflow" argument is not understood by my cmake version 3.26.4 despite the argument being introduced in 3.25?
In my sleep-deprived delirium I had originally misread the "build" files as "built" files... so have to manually do the workflow steps if I can't upgrade to a cmake that has workflow.
Manually:
cd build/clang-release
ninja

running into more requirements ( spdlog )
but now out of time.
... to be continued...
Also, I see you have a link in the git  to your local directory structure:
kdevcxx_with_ai_settings -> /home/artur/.config/kdevcxx_with_ai

have you tried:
cd <git root>
cmake -S . -B builddir
cmake --build builddir

yes, that seems to  work better.
I'm still getting spdlog  errors however.
ie: "/usr/include/spdlog/common.h:168:111: error: ‘basic_runtime’ is not a member of ‘fmt’"
spdlog version:
-- CPM: adding package<EMAIL_ADDRESS>(v1.13.0)
I'll try to get time to look into it more myself.. but if anything obvious comes to mind please let me know.
Thanks

spdlog had gotten out of sync with the fmt library it uses.
This has been fixed in spdlog 1.14.0
I changed line 92 in  kdevcxx_with_ai/CMakeLists.txt to v1.14.0:
CPMAddPackage(
  NAME spdlog
  GITHUB_REPOSITORY gabime/spdlog
  GIT_TAG v1.14.0
)

re: https://github.com/gabime/spdlog/issues/3070

It was then trying to compile against my local install of spdlog.
I needed to modify:
kdevcxx_with_ai/ai_processing/CMakeLists.txt
added  below line 13  ( i.e. to target_link_libraries):
spdlog::spdlog
now I'm getting  ai_processing/source/network.cc  errors.. which I'll look into next...  out of time for now.


MSSQL unique creates index instead of column constraint

Environment
Knex version: ^0.95.14
Database + version: Microsoft SQL Azure (RTM) - 12.0.2000.8
OS: macOS 11.6.1
@smorey2
Bug

Explain what kind of behaviour you are getting and how you think it should do

exports.up = function (knex, Promise) {
  return knex.schema
    .withSchema("meta")
    .createTable("constraint_artefact_type", function (table) {
      table.increments("constraint_artefact_type_id");
      table.string("value").notNullable();
      table.unique("value");
    });
};

https://github.com/knex/knex/blob/27ade6f8814a5601916489a96474b55649e15462/lib/dialects/mssql/schema/mssql-tablecompiler.js#L307
According to this code, this will generate
CREATE TABLE [meta].[constraint_artefact_type] ([constraint_artefact_type_id] int identity(1,1) not null primary key, [value] nvarchar(255) not null;
CREATE UNIQUE INDEX [constraint_variable_object_type_value_unique] ON [meta].[constraint_variable_object_type] ([value]) WHERE [value] IS NOT NULL;

However, this filtered unique index has made it impossible to use [value] column in subsequent Foreign Key constraints. Below statement will fail creating foreign key. This is highlighted in current implementation (https://stackoverflow.com/questions/767657/how-do-i-create-a-unique-constraint-that-also-allows-nulls/767702#767702)
exports.up = function (knex, Promise) {
  return knex.schema
    .withSchema("meta")
    .createTable("artefact", function (table) {
      table
        .string("type")
        .notNullable();
      table
        .foreign("type")
        .references("value")
        .inTable("meta.constraint_artefact_type")
        .onDelete("SET NULL");
      table.unique(["name", "source"]);
    });
};

Expected behaviour here is  table.unique("value") would be generating a UNIQUE constraint on [value] column (which would be similar to postgres)
CREATE TABLE [meta].[constraint_artefact_type] ([constraint_artefact_type_id] int identity(1,1) not null primary key, [value] nvarchar(255) not null UNIQUE;

or
CREATE TABLE [meta].[constraint_artefact_type] ([constraint_artefact_type_id] int identity(1,1) not null primary key, [value] nvarchar(255) not null;
ALTER TABLE  [meta].[constraint_artefact_type] ADD CONSTRAINT constraint_variable_object_type_value_unique UNIQUE(value);

Using UNIQUE constraint, subsequent foreign key constraints would not fail.

Error message

RequestError: CREATE TABLE [meta].[artefact] (... [type] nvarchar(255) not null... CONSTRAINT [artefact_type_foreign] FOREIGN KEY ([type]) REFERENCES [meta].[constraint_artefact_type] ([value]) ON DELETE SET NULL) - Could not create constraint or index.

MSSQL returns following error if SQL statements provided in debug mode are manually executed:
Failed to execute query. Error: There are no primary or candidate keys in the referenced table 'meta.constraint_artefact_type' that match the referencing column list in the foreign key 'artefact_type_foreign'.

Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.

exports.up = function (knex, Promise) {
  return knex.schema
    .withSchema("meta")
    .createTable("constraint_artefact_type", function (table) {
      table.increments("constraint_artefact_type_id");
      table.string("value").notNullable();
      table.unique("value");
    });
};

exports.up = function (knex, Promise) {
  return knex.schema
    .withSchema("meta")
    .createTable("artefact", function (table) {
      table
        .string("type")
        .notNullable();
      table
        .foreign("type")
        .references("value")
        .inTable("meta.constraint_artefact_type")
        .onDelete("SET NULL");
      table.unique(["name", "source"]);
    });
};

I originally thought it peculiar as well, however, on looking more closely, I found that unique is documented as creating an index, not a constraint:
https://github.com/knex/documentation/blob/48fcde1d402d13eb8123cefc9ed618e126e74273/sections/schema.js#L822-L826
Where I've wanted a unique constraint, I've used knex.raw. However, customizing the details of the index is what the options bucket is there for; the most flexible option is likely allowing to replace the WHERE clause entirely with whatever you want, or set it to some sort of sentinel to remove it.
SQL Server is rather elaborate in its unique index config, while Postgres is quite spartan. Roundup:

SQL Server: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql?view=sql-server-ver15
Oracle: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5010.htm (and function-based unique indexes are kinda neat https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5010.htm#BGEHDECJ )
CockroachDB: https://www.cockroachlabs.com/docs/v21.1/create-index.html
MariaDB: https://mariadb.com/kb/en/create-index/
Postgres: https://www.postgresql.org/docs/current/indexes-unique.html

(A "where" clause when creating an index looks to be SQL Server-only to me, aside from CockroachDB inverted index creation.)

@jeremy-w what about a flag on table.unique which allows the creation of either an index or a constraint for MSSQL?
My only concern with knex.raw is the interoperability between DB engines.

The current implementation of table.unique adding the filter WHERE ([value] IS NOT NULL) in MSSQL allows any number of NULL values to be inserted into that 'unique' column.
This behaviour sounds like a bug. Why would a column column marked unique not restrict NULL values, just like any other value.
Perhaps provide an option to users for filtering, but by default there should be no filter.

It’s not a bug - it’s actually the SQL standard behavior. NULL is not equal to NULL - it’s like asking whether the gifts in two still-wrapped presents are equal or not.
knex uses the implementation it does in order to behave the same as other engines that do follow the standard. It could certainly be unexpected if you are just targeting MSSQL and have not worked with other engines, though.
Would you like to provide a PR that implements the suggested option?
Jeremy W. Sherman
http://jeremywsherman.com/

On Dec 12, 2021, at 04:20, ashley-mallia @.***> wrote:

The current implementation of table.unique adding the filter WHERE ([value] IS NOT NULL) in MSSQL allows any number of NULL values to be inserted into that 'unique' column.
This behaviour sounds like a bug. Why would a column column marked unique not restrict NULL values, just like any other value.
Perhaps provide an option to users for filtering, but by default there should be no filter.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Released in 1.0.1.


Use System.Drawing again.

Needs testing on linux.

Pending development on an upstream fix for a mono problem.

https://github.com/mono/libgdiplus/pull/43


Change the layout to a more screen appropriate format

Summary
Easy change of the view from portrait to landscape mode - more user-friendly when reading document on mobile device (laptops, tablets)
Details
Is there a way to change the view from portrait to landscape mode, so my peers can read the document on a mobile device? In times, where scientific documents often get read on devices which have an aspect ratio of 16:9, it would be neat to hand the document in a more matching format than A4.
Additional context
In the last two years, the request to hand in work in a matching format for scientific documents (landscape, or similar 16:9) increased massively at my university. My professors tend to read the documents on a laptop screen anyway.
If there is already an option to format the kaobook into a more screen related aspect ratio, I would appreciate getting an answer on this topic.
Sincerely,
Tobias Dossinger

There is an option: a4paperlandscape. See also #85. It'd be nice to have an option for 16:9, too, so I'll probably add it later. If I'm too slow and you want to give it a try before me, it should be as easy as adding one line after this one, one just needs to figure out the appropriate ratios with the a4 dimensions.

I've added (and documented) an 169paperlandscape option. Feel free to reopen the issue if something doesn't work or you need something else.

After I opened this issue last week, I found the option: a4paperlandscape, but forgot to modify the issue. Thanks for hint about the option.
I was just about to start to implement the 16:9 aspect-ratio, then I saw that you already did it. 🥇 I'll keep you posted, if some notable bug occurs.
Thanks for the fast reply and implementation.