This file contains hidden or 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 tensorflow as tf | |
| import numpy as np | |
| # XOR | |
| X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) | |
| Y = np.array([0, 1, 1, 0]) | |
| model = tf.keras.Sequential([ | |
| tf.keras.layers.Dense(8, activation=tf.nn.sigmoid), | |
| tf.keras.layers.Dense(1, activation=None) |
This file contains hidden or 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 tensorflow as tf | |
| import numpy as np | |
| # And | |
| X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) | |
| Y = np.array([0, 0, 0, 1]) | |
| model = tf.keras.Sequential([ | |
| tf.keras.layers.Dense(1, activation=None) | |
| ]) |
This file contains hidden or 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
| X = [2, 3, 4] | |
| Y = [50, 60, 70] | |
| a = 20 | |
| b = 10 | |
| # H = a * X + b | |
| for i in range(200): # 100๋ฒ ํ์ต ๊ณผ์ ์ ์งํํ๋ค. |
This file contains hidden or 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 gym | |
| import numpy as np | |
| import warnings | |
| import cv2 | |
| from gym import error, spaces, utils | |
| from gym.utils import seeding | |
| class SnakeGameEnv(gym.Env): | |
| metadata = {'render.modes': ['human', 'rgb_array']} |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| import matplotlib.animation as animation | |
| import numpy as np | |
| import pandas as pd | |
| class ANI_Scatter(object): | |
| """An animated scatter plot using matplotlib.animations.FuncAnimation.""" | |
| def __init__(self, numpoints, area, e): | |
| # ๊ฐ์ฒด ์, ์ด๋ ์์ญ |
This file contains hidden or 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
| def solution(arrangement): | |
| answer = 0 | |
| depth = 0 | |
| def isLaser(index): | |
| if (arrangement[index] == '(' and arrangement[index + 1] == ')')\ | |
| or (arrangement[index] == ')' and arrangement[index - 1] == '('): | |
| return True | |
| else: | |
| return False |
This file contains hidden or 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 | |
| # Setting for learning Neural Network | |
| N = 4 # N = number of training data | |
| Max = 10000 +1 # number of epochs to repeat | |
| learning_rate = 1 # learning rate | |
| # Define some functions | |
| def sigmoid(x): |
This file contains hidden or 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
| pragma solidity >=0.4.22 <0.6.0; | |
| // pragma experimental ABIEncoderV2; | |
| contract MadicalDataRecordSystem { | |
| struct MadicalRecord { | |
| uint patient_id; // ๋๊ฐ | |
| uint timestamp; // ์ธ์ | |
| uint hospital_id; // ์ด๋์ | |
| uint record_type; // ์ด๋ป๊ฒ ( 0: ์๋ชป๋ ํค๋, 1: ์ง๋ฃ, 2: ์์ , 3: ์ฒ๋ฐฉ ) |
This file contains hidden or 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
| pragma solidity ^0.5.0; | |
| pragma experimental ABIEncoderV2; | |
| contract CostModel { | |
| address owner; | |
| uint globalIndex; | |
| struct Item { | |
| address owner; |
This file contains hidden or 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
| pragma solidity ^0.5.2; | |
| contract Ballot { | |
| struct Voter { | |
| uint weight; | |
| bool voted; | |
| address delegate; | |
| uint vote; | |
| } |