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 nltk | |
from nltk.corpus import treebank | |
# Tải dữ liệu treebank | |
nltk.download('treebank') | |
tagged_sentences = treebank.tagged_sents() | |
# Chia dữ liệu thành tập huấn luyện và tập kiểm tra | |
train_size = int(0.8 * len(tagged_sentences)) | |
train_sents = tagged_sentences[:train_size] |
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 torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import numpy as np | |
import matplotlib.pyplot as plt |
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 | |
import matplotlib.pyplot as plt | |
from sklearn.decomposition import PCA | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.metrics import accuracy_score | |
from tensorflow.keras.datasets import cifar10 | |
(x_train, y_train), (x_test, y_test) = cifar10.load_data() | |
print(f"Train data shape: {x_train.shape}") |
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 xgboost as xgb | |
import pandas as pd | |
import numpy as np | |
from sklearn.datasets import load_iris | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score | |
iris = load_iris() | |
X = iris.data | |
y = iris.target |
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 torch | |
import torch.nn as nn | |
class IoULoss(nn.Module): | |
def __init__(self, num_classes, eps=1e-6): | |
""" | |
IoU Loss for multi-class image segmentation. | |
Args: | |
- num_classes (int): Number of classes (C). |
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 torch | |
import torch.nn as nn | |
import torch.optim as optim | |
from torch.nn.functional import relu, max_pool2d | |
from torch.utils.data import DataLoader | |
from torchvision import datasets | |
from torchvision import transforms as T | |
from tqdm import tqdm | |
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
#include "display.h" | |
#include "count.h" | |
#include <iostream> | |
using namespace std; | |
void displayWinning() | |
{ | |
const vector<string> figures = { | |
" O \n" |
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
// TODO: read all numbers (int, float), separated by comma | |
// TODO: read a table of numbers from a text file, separated by comma | |
// TODO: read a table of student information from a text file, separated by comma | |
// (ten, tuoi, gioi tinh, diem trung binh) |
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
// struct_tutorial.cpp: struct examples | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
struct Vector { | |
int x; | |
int y; | |
// constructor |
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
#include <SFML/Graphics.hpp> | |
#include <iostream> | |
#include <vector> | |
typedef std::vector<char> Row; | |
typedef std::vector<Row> GameState; | |
const int SIZE=3; | |
sf::CircleShape createShape(sf::Texture& texture, int i, int j, char player) | |
{ |
NewerOlder