Skip to content

Instantly share code, notes, and snippets.

@FriedGil
FriedGil / NN.java
Last active October 23, 2023 14:01
APCS-Compliant Neural Network
import java.util.Arrays;
public class NN {
private final int featuresize;
private final int hiddenSize;
private final int outputSize;
private double[][] weights1;
private double[][] weights2;
private double[] hiddenLayer;
#Misinformation Classication with GPT-4
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.llms import OpenAI
from langchain.chat_models import ChatOpenAI
from langchain import SerpAPIWrapper
from langchain.document_loaders import WebBaseLoader
from langchain.tools import tool
import requests
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.
#Instead of x and o players are 1 and -1
def eval(board): #returns 1 if player 1 wins, 0 if no player wins, -1 if player -1 wins
for i in range(3):
if board[i*3] == board [i*3 + 1] == board[i*3 +2] and board[i*3]!=0: #Horizontal
return board[i*3]
if board[i] == board[i+3] == board [i+6] and board[i*3]!=0: #Vertical
return board[i]
if board[0] == board[4] == board[8] and board[0]!=0: #Diagonal 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.