LeetCode

[HashMap] Ransom Note

HashMap = Dictionary in python  The point of this problem is to create a HashMap that stores the counts of the letters that appears in magazine, and subtract counts if the same letter is in ransomNote.  The problem was setting the if conditions,  1. char must be in the counter (obiviously), otherwise we cannot make ransomNote with magazine2. Each letter should be used once in magazine, so the wo..

LeetCode

[Linked List] Middle of the Linked List

Linked List 자료구조를 다루는 문제이다.  Pointer 2개를 사용하는 테크닉을 사용하여 중간의 node를 리턴하는 방식이다. slow pointer는 옆으로 한 칸만 가고, fast pointer는 딱 2배의 속도인 옆으로 두 칸을 간다. 만약 fast pointer가 linked list의 끝에 도달하거나 끝보다 더 뒤에 있는 식으로 도달한다면, slow pointer는 자동으로 중간에 위치할 것이다(속도가 딱 반이므로, fast가 끝에 도달하면 slow는 그 반절인 중간에 있을 것). Linked list이므로 일단 두 pointer를 head로 initialize해주고, 뒤의 node에 접근하고 싶은 경우 .next 를 써주면 된다. 뒤의 뒤 node에 접근하고 싶은 경우 .next.n..

Neural Networks

LSTM (Long Short Term Memory) 직관적 설명

LSTM은 기존의 Vanilla RNN이 long-term memory에 취약하다는 단점을 보완하기 위해 나온 아키텍처이다. 기존의 RNN은 동일한 weight와 구조로 layer가 계속 반복되다 보니 vanishing gradient / exploding gradient 문제가 있었고, 이로 인한 long-term memory를 기억하는 데에 문제가 생기게 된다. LSTM은 큰 틀에서 이 문제를 short-term memory가 flow 할 수 있게 하는 path, long-term memory가 flow 할 수 있게 하는 path를 구분하여 두면서 해결하고자 하였다.  LSTM의 해결책 LSTM의 구조에 대한 가장 유명한 그림이다.  중간에 구조들이 보이는 것이 하나의 LSTM block이고, 이러한..

Decision Making

[논문리뷰] Neural Additive Models: Interpretable Machine Learning with Neural Nets

Interpretable Modeling 관련하여 찾아던 중 Neural Additive Models: Interpretable Machine Learning with Neural Nets 이라는 논문을 찾아 간단하게 공부하게 되었다. (Spotlight (Top 3%) at NeurIPS 2021)   Deep Neural Networks(DNN)이 black-box이기 때문에 healthcare, finance, criminal justice와 같이 고위험군 task에서는 적용가능성에 문제점이 있기에 더욱 더 interpretation 가능한 방법론이 필요하다고 말한다. 기존의 방법론인 LIME과 같은 방법론들은 모델의 behavior에 대한 설명 디테일이 부족하거나, fail to provide a..

Decision Making

Generalized Additive Models(GAMs)

GAM이란? Generalized Additive Models (GAMs) are a type of statistical model that extend Generalized Linear Models (GLMs) by allowing the linear predictor to be a sum of smooth functions of the predictor variables. This flexibility makes GAMs highly effective for capturing non-linear relationships between predictors and the response variable. GLM의 연장선이며 smooth function을 추가해 독립변수와 종속변수 간의 non-linear..

ShinyJay
ShinyLab