Blog

Uncategorized
admin

Fashion image generator website

Fashion Image Generator Website Video Demo: https://youtu.be/czrE6WhSQfc?si=Mpr7etCpIWHDSWiP Description: Train ML models with tensorflow and Host them on website with Flask. To save your model you can simply run: generator.save(“YOURMODELNAME.hd5″) You can change the image data set and increase the epoch from 10 to 50 in the notebook provided. train_dcgan(gan, dataset, batch_size, num_features, epochs=50) You can deepen the model structure as well to have a much better results. generator = keras.models.Sequential([ keras.layers.Dense(7 * 7 * 128, input_shape=[num_features]), keras.layers.Reshape([7, 7, 128]), keras.layers.BatchNormalization(), keras.layers.Conv2DTranspose(64, (5,5), (2,2), padding=”same”, activation=”selu”), keras.layers.BatchNormalization(), keras.layers.Conv2DTranspose(1, (5,5), (2,2), padding=”same”, activation=”tanh”), ]) The model is hosted using FLASK and you

Read More »
Uncategorized
admin

Aversarial Networks

  Farhad Piri¶ Adversarial Networks¶ Generate Synthetic Images with DCGANs in Keras Import Libraries¶ In [3]: import sys sys.path.insert(1, ‘/kaggle/input/module-of-plot-utils’) In [4]: %matplotlib inline import tensorflow as tf from tensorflow import keras import numpy as np import plot_utils import matplotlib.pyplot as plt from tqdm import tqdm print(‘Tensorflow version:’, tf.__version__) /opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.3 warnings.warn(f”A NumPy version >={np_minversion} and <{np_maxversion}” Tensorflow version: 2.13.0 Load and Preprocess the Data¶ In [5]: (x_train, y_train), (x_test, y_test) = tf.keras.datasets.fashion_mnist.load_data() x_train = x_train.astype(np.float32) / 255.0 x_test = x_test.astype(np.float32) / 255.0 Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/train-labels-idx1-ubyte.gz

Read More »
Uncategorized
admin

How to process data before any ML task

  Farhad Piri¶ Crucial Data preprocessings before any algorithms¶ In [1]: #!pip install zipcodes In [2]: #!pip install basemap In [3]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import zipcodes as zcode from sklearn.model_selection import train_test_split , GridSearchCV from sklearn import metrics from sklearn.linear_model import LogisticRegression, LinearRegression from sklearn.metrics import classification_report, confusion_matrix from sklearn.neighbors import KNeighborsClassifier from sklearn.naive_bayes import ComplementNB from warnings import filterwarnings filterwarnings(“ignore”) In [4]: Data = pd.read_csv(‘Bank_Personal_Loan_Modelling.csv’) df = pd.DataFrame(Data) df Out[4]: ID Age Experience Income ZIP Code Family CCAvg Education Mortgage Personal Loan Securities Account CD Account Online CreditCard 0 1

Read More »
Uncategorized
admin

DataMining with PCA (Where to spend 100M$?)

  Farhad Piri¶ DATA MINING WITH PCA Loadings plot¶ Where to spend 100M $ budget?¶ In [1]: import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import matplotlib.pyplot as plt In [3]: data = pd.read_csv(‘/kaggle/input/countrydatacsv/Country-data.csv’) In [4]: data Out[4]: country child_mort exports health imports income inflation life_expec total_fer gdpp 0 Afghanistan 90.2 10.0 7.58 44.9 1610 9.44 56.2 5.82 553 1 Albania 16.6 28.0 6.55 48.6 9930 4.49 76.3 1.65 4090 2 Algeria 27.3 38.4 4.17 31.4 12900 16.10 76.5 2.89 4460 3 Angola 119.0 62.3 2.85 42.9 5900 22.40 60.1 6.16 3530 4 Antigua and Barbuda 10.3 45.5 6.03

Read More »
Uncategorized
admin

My complex and extendable skill type

 Let`s dive into the skill type implementation I coded for a more generalized approach to handle unique character skills and their pool effects. The abilities could include but not limited to: Stun : Stuns the enemy and in which case the enemy misssed the turn the generalize method takes into account the case in which a hero ability could stun ally and enemy heroes at the same time with different stun turns. This twist should be implemented in a way that Turn manager loops through all the pool effects and processes the pool effects befor ending the turn. Burn: This

Read More »