Gradient descentë¶í° AMSGradê¹ì§ ìµì í ìê³ ëŠ¬ìŠì ëíŽ ìê°íë ìë£ì ëë€. ì¶ê°ë¡ Hessian free ìê³ ëŠ¬ìŠìž SR1, DFP, BFGSì ëíŽìë ê°ëµí ìê°íê³ , ìê³ ëŠ¬ìŠì ìê°ííì¬ ë¹êµí ìë£ì ëë€. This slide introduces the optimization algorithms from first-order(gradient descent) to second-order(hessian free). It deals with all the algorithms in the Keras optimizer. It was made by Taewon Heo.
R.R.E.F.U (Uniqueness of Reduced Row Echelon Form)Changki Yun
Ìý
Korean Explanation to prove the uniqueness of "Reduced Row Echelon Form(RREF)" a matrix.
ìŽë€ íë ¬ì Reduced Row Echelon Form (RREF)ê° ì ìŒíšì 볎ì ëë€.
R.R.E.F.U (Uniqueness of Reduced Row Echelon Form)Changki Yun
Ìý
Korean Explanation to prove the uniqueness of "Reduced Row Echelon Form(RREF)" a matrix.
ìŽë€ íë ¬ì Reduced Row Echelon Form (RREF)ê° ì ìŒíšì 볎ì ëë€.
[FreivaldsAlgorithm]The Freivalds Algorithm is an algorithm that determines w...Bomm Kim
Ìý
The Freivalds Algorithm is an algorithm that determines whether AB=C is true/false with a time complexity of O(n2) when there are matrices A, B, and C.
This is a slide with an explanation and implementation code.
6. https://www.acmicpc.net/problem/5615
def is_prime(n):
i = 5
if n % 2 == 0:
return n == 2
if n % 3 == 0:
return n == 3
while i * i <= n:
if n % i == 0:
return False
i += 2
return n != 1
N = int(sys.stdin.readline())
ans = 0
for i in range(N):
s = int(sys.stdin.readline())
if is_prime(s * 2 + 1):
ans += 1
print(ans)
Python
#include<iostream>
using namespace std;
using llu = unsigned long long;
int is_prime(llu n) {
llu i = 5;
if (n % 2 == 0)
return n == 2;
if (n % 3 == 0)
return n == 3;
while (i * i <= n) {
if (n % i == 0)
return 0;
i += 2;
}
return n != 1;
}
int main() {
llu N;
cin >> N;
llu a = 0;
for (int i = 0; i < N; i++) {
llu s;
cin >> s;
if (is_prime(s * 2 + 1))a++;
}
cout << a << endl;
}
C++
24. https://www.acmicpc.net/problem/5615
import sys
def fast_safe_mod(x, y, z):
ret = 1
x %= z
while y:
if y % 2 == 1:
ret = ((ret % z) * (x % z)) % z
y //= 2
x = ((x % z) * (x % z)) % z
return ret
def is_probability_prime(p):
if p < 2:
return False
a = [2, 7, 61]
i = 0
while i < len(a) and a[i] < p:
x = p - 1
while True:
r = fast_safe_mod(a[i], x, p)
if r == p - 1:
break
if x % 2 == 1:
if r == 1:
break
else:
return False
x /= 2
i += 1
return True
N = int(sys.stdin.readline())
ans = 0
for i in range(N):
s = int(sys.stdin.readline())
if is_probability_prime(s * 2 + 1):
ans += 1
print(ans)
Python
#include<iostream>
#include<vector>
using namespace std;
using llu = unsigned long long;
llu fast_safe_mod(llu x, llu y, llu z) {
llu ret = 1LL;
x %= z;
while (y) {
if (y & 1) {
ret = ((ret % z) * (x % z)) % z;
}
y /= 2;
x = ((x % z) * (x % z)) % z;
}
return ret;
}
llu is_probability_prime(llu p) {
if (p < 2) {
return false;
}
vector<llu> a = {2, 7, 61};
llu i = 0;
while (i<a.size() && a[i] < p) {
llu s = p - 1;
while (true) {
llu r = fast_safe_mod(a[i], s, p);
if (r == p - 1) break;
if (s & 1) {
if (r == 1)break;
else return false;
}
s >>= 1;
}
i++;
}
return true;
}
int main() {
llu N;
cin >> N;
llu a = 0;
for (int i = 0; i < N; i++) {
llu s;
cin >> s;
if (is_probability_prime(s * 2 + 1))a++;
}
cout << a << endl;
return 0;
}
C++