This file contains 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
''' | |
# Transcription to JSONL Converter | |
## 概要 | |
LibriSpeechデータセットの転写ファイル(.trans.txt)を処理し、構造化されたJSONLファイルに変換します。また、必要に応じて関連する本文をProject Gutenbergからダウンロードします。 | |
## 主な機能 | |
1. 転写ファイル(.trans.txt)の読み込みと処理 | |
2. 章情報(CHAPTERS.txt)と話者情報(SPEAKERS.txt)の統合 | |
3. 本文ファイルの存在確認と必要に応じたダウンロード |
This file contains 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
/* | |
# M5Unified Touch Circles Documentation | |
## 概要 | |
このプログラムは、M5Unifiedデバイス上でタッチ操作を検出し、視覚的フィードバックを提供すると同時に、I2C経由で外部デバイスにマウス操作をシミュレートします。 | |
一般的なUSBやシリアルのプロトコルではなく、専用のI2Cプロトコルを話します。 | |
## 主要機能 |
This file contains 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
#include <M5Atom.h> | |
#include <Wire.h> | |
// 高位4ビット(0-F)の5x3パターン | |
const uint8_t hexPatternsHigh[16][5] = { | |
// 0 | |
{0b111, 0b101, 0b101, 0b101, 0b111}, | |
// 1 | |
{0b010, 0b110, 0b010, 0b010, 0b111}, | |
// 2 |
This file contains 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
import numpy as np | |
import torch | |
import torch.nn.functional as F | |
from pytorch_metric_learning.utils import common_functions as c_f | |
from pytorch_metric_learning.losses.large_margin_softmax_loss import LargeMarginSoftmaxLoss | |
class MagFaceLoss(LargeMarginSoftmaxLoss): | |
""" | |
Implementation of MagFace: https://arxiv.org/pdf/1801.07698.pdf (extension to ArcFace) | |
""" |
This file contains 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
#include <ogg/ogg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
// get_opus_raw関数のプロトタイプ | |
// この関数は外部で定義され、Opusエンコードされたraw binaryを提供します。 | |
int16_t get_opus_raw(uint8_t *buffer); |
This file contains 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
import SwiftUI | |
@_spi(Advanced) import SwiftUIIntrospect | |
struct DelegateEnabledScrollView<Content: View>: View { | |
@State private var scrollViewDelegate: DelegateEnabledScrollViewDelegate? | |
@State private var scrollView: UIScrollView? = nil | |
let content: (UIScrollView?) -> Content | |
var onDidZoom: ((UIScrollView) -> Void)? | |
var onWillBeginDragging: ((UIScrollView) -> Void)? |
This file contains 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
/* | |
https://github.com/karpathy/llama2.c/blob/master/run.c | |
GPT-4による解説 | |
このプログラムは、Transformerネットワークを実装し、トークン化されたテキスト入力から次の最も適したトークンを予測します。具体的には以下のようになります: | |
先頭の部分は、TransformerWeightsとRunStateという2つのデータ構造とそれらの関連するメモリの管理を含みます。 | |
Configという構造体は、トランスフォーマーネットワークのパラメータを保持します。 | |
次に、指定されたチェックポイントファイルから重みを初期化する関数があります。この関数は、チェックポイントファイルからトランスフォーマーネットワークの重みを読み込み、適切に配置します。 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
// https://github.com/pschatzmann/arduino-audio-tools/ settings for M5Stack Core2 | |
// Audio settings | |
const int sample_rate = 44100; | |
const int channels = 1; | |
// Speaker settings | |
I2SStream out; | |
auto config = out.defaultConfig(TX_MODE); | |
config.sample_rate = sample_rate; |
NewerOlder