This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| query MyQuery { | |
| users(where: {borrowedReservesCount_gte: 5}, first: 1000) { | |
| borrowHistory { | |
| borrowRate | |
| borrowRateMode | |
| amount | |
| id | |
| timestamp | |
| } | |
| liquidationCallHistory(where: {}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def train(model, iterator, optimizer, loss_func): | |
| #Initializing them | |
| epoch_loss = 0 | |
| epoch_accuracy = 0 | |
| #Gets the model in training mode | |
| model.train() | |
| for batch in iterator: | |
| #Set the gradietns to 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TEXT = Field(tokenize=tok,batch_first=True,include_lengths=True) | |
| LABEL = Field(sequential=False, use_vocab=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| train_iter = BucketIterator(train_thing, batch_size=bs, sort_key=lambda x: len(x.sequence), | |
| device=device, sort=True, sort_within_batch=True) | |
| valid_iter = BucketIterator(valid_thing, batch_size=bs, sort_key=lambda x: len(x.sequence), | |
| device=device, sort=True, sort_within_batch=True) |