Skip to content

Instantly share code, notes, and snippets.

View rsimd's full-sized avatar

riki.m rsimd

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsimd
rsimd / pyproject.toml
Created July 23, 2023 07:13
`pyproject.toml` for `rye` to install `pytorch` that can use `cuda` (wip)
[project]
name = "dsbook"
version = "0.1.0"
description = "Add a short description here"
dependencies = [
"numpy>=1.24.4",
"scipy>=1.10.1",
"pandas>=2.0.3",
"matplotlib>=3.7.2",
"plotly>=5.15.0",
@rsimd
rsimd / pyproject.toml
Last active July 20, 2023 14:13
This pyproject.toml was written for rye to install the cuda version of jax. cuda and cudnn versions are hard-corded, so you need to rewrite the "jax" and "jaxlib" lines in the dependencies column to match your environment.
[project]
name = "topics"
version = "0.1.0"
description = "Add a short description here"
dependencies = [
"numpy>=1.24.4",
"scipy>=1.10.1",
"pandas>=2.0.3",
"matplotlib>=3.7.2",
"plotly>=5.15.0",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

サイエンスキャッスル

サイエンスキャッスル研究費

» サイエンスキャッスル研究費 | 中高生のための学会 サイエンスキャッスル by リバネス https://s-castle.com/grant/

対象:中学生、高校生、 高等専門学校生(3年生以下)

中高生研究者の研究プランに研究費、そして、 研究に伴走する研究者からのアドバイスを提供します。 サイエンスキャッスル研究費は、自らの研究に情熱を燃やし、独創的な研究を進める中高生研究者を助成する研究助成制度です。サイエンスキャッスルの取り組みに共感する企業や大学の研究者とともに、皆さんの研究活動に伴走し、推進していきます。

import io, os, requests
from typing import Callable, Optional,Any
import numpy as np
import pandas as pd
import torch
import pytorch_lightning as pl
import fugashi
from tqdm.auto import tqdm
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
2 50
the 0.418 0.24968 -0.41242 0.1217 0.34527 -0.044457 -0.49688 -0.17862 -0.00066023 -0.6566 0.27843 -0.14767 -0.55677 0.14658 -0.0095095 0.011658 0.10204 -0.12792 -0.8443 -0.12181 -0.016801 -0.33279 -0.1552 -0.23131 -0.19181 -1.8823 -0.76746 0.099051 -0.42125 -0.19526 4.0071 -0.18594 -0.52287 -0.31681 0.00059213 0.0074449 0.17778 -0.15897 0.012041 -0.054223 -0.29871 -0.15749 -0.34758 -0.045637 -0.44251 0.18785 0.0027849 -0.18411 -0.11514 -0.78581
, 0.013441 0.23682 -0.16899 0.40951 0.63812 0.47709 -0.42852 -0.55641 -0.364 -0.23938 0.13001 -0.063734 -0.39575 -0.48162 0.23291 0.090201 -0.13324 0.078639 -0.41634 -0.15428 0.10068 0.48891 0.31226 -0.1252 -0.037512 -1.5179 0.12612 -0.02442 -0.042961 -0.28351 3.5416 -0.11956 -0.014533 -0.1499 0.21864 -0.33412 -0.13872 0.31806 0.70358 0.44858 -0.080262 0.63003 0.32111 -0.46765 0.22786 0.36034 -0.37818 -0.56657 0.044691 0.30392
@rsimd
rsimd / term_score.py
Created September 9, 2021 01:33
term-score for topic models, 間違いがあれば指摘してくれると助かります。
import numpy as np
from scipy.special import softmax as np_softmax
def term_score(beta:np.array, dtype=np.float32) -> np.array:
"""reference: http://db-event.jpn.org/deim2011/proceedings/pdf/f4-1.pdf
"""
β = np.array(beta)
(K,V) = beta.shape
if not (K-0.3) < beta.sum() < (K+0.3):
β = np_softmax(beta, axis=-1)
FROM tensorflow/tensorflow:2.0.0-gpu-py3
WORKDIR /libtopicmodel
COPY . /libtopicmodel/
#RUN pip3 install poetry==1.0.0b8
#RUN poetry install
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
ARG PYTHON_VERSION=3.7
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
@rsimd
rsimd / 1.cuda installation.md
Last active June 30, 2019 19:58
ubuntu 18.04にcuda/cudnnなどをインストール