Skip to content

Instantly share code, notes, and snippets.

View SupreethRao99's full-sized avatar
🇮🇳

Supreeth Rao SupreethRao99

🇮🇳
View GitHub Profile
@SupreethRao99
SupreethRao99 / colab-issue.ipynb
Created July 28, 2021 13:22
colab-issue.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SupreethRao99
SupreethRao99 / WeightedKappaLoss.py
Created November 5, 2021 09:57
Pytorch Implementation of WeightedKappaLoss
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
class WeightedKappaLoss(nn.Module):
"""
Implements Weighted Kappa Loss. Weighted Kappa Loss was introduced in the
[Weighted kappa loss function for multi-class classification
@SupreethRao99
SupreethRao99 / tflite_rnnt_conv.md
Created April 8, 2022 03:48
Inference code for RNN-Transducer
  1. To convert to tflite, clone the TensorflowASR repository and build its dependencies
git clone https://github.com/TensorSpeech/TensorFlowASR.git
cd TensorFlowASR
pip3 install -e ".[tf2.8]"
  1. Download the model weights and config file from here (https://drive.google.com/drive/folders/1rYpiYF0F9JIsAKN2DCFFtEdfNzVbBLHe?usp=sharing)
  2. Add the downloaded config file to the same directory as the conversion file. ie to ./TensorFlowASR/examples/rnn_transducer/inference/
  3. Change the code in gen_tflite_model.py to the code below
some very long text afowngewngoewtg2w,
agnuwrgnuwrgwrgwrhwnu. wgnwoguwe w hgr3g,
wgorgunrugnm3w[wrgw,
ewgwignwginweiuwengwingien,
ewrgiuewrbgoyiweynvn,
wqgwqgnin gq3-9nugq-gqg 3g93ugn2q-,
giqwnbbwiopngaowgnqwgqoghqprubq,
eboginwerobwienqq,
@SupreethRao99
SupreethRao99 / findgpu.md
Created September 6, 2022 06:29
PyTorch GPU Helper

Moving to a specific GPU

cuda = torch.device('cuda')     # Default CUDA device, In our case it's Nvidia RTX 3090 
cuda0 = torch.device('cuda:0')  # specifies the CUDA device to be NVIDIA GeForce RTX 3090
cuda1 = torch.device('cuda:1')  # specifies the CUDA device to be NVIDIA GeForce RTX 3080

Example:
  x = torch.tensor([1., 2.], device=cuda0)
  # x.device is device(type='cuda', index=0)