artificial-intelligence

Multiclass ROC curves in R

限于喜欢 提交于 2021-02-08 04:37:26
问题 I'm new to the concept of ROC curves . I've tried to understand it by reading a few tutorials on the web. I found a really good example here in python which was helpful. I want to plot a ROC curve for multiclass classifier that I built(in Python). However, Most of the solutions on the web are for 2 class problems and not multiclass . However, I finally found "multiclass.roc" function in pROC package in R which does multiclass ROC curve plotting. The following is a simple example: library(pROC

Getting Started with Neural Networks (ANN)?

霸气de小男生 提交于 2021-02-05 13:33:39
问题 I've been involved with a lot of C-Programming and RT-Linux, now I want to do some Artificial Neural Networking. BUT: How do I get started? I'm also very interested in Evolutionary Algorithms(Learning Algorithms) and Artificial Intelligence. Where can I start learning all of this? 回答1: If you're just trying to get familiar with AI, then I would recommend that you take the Stanford's free online courses: https://www.ai-class.com/ http://www.ml-class.org/course/auth/welcome Get a good

Getting Started with Neural Networks (ANN)?

不羁的心 提交于 2021-02-05 13:30:36
问题 I've been involved with a lot of C-Programming and RT-Linux, now I want to do some Artificial Neural Networking. BUT: How do I get started? I'm also very interested in Evolutionary Algorithms(Learning Algorithms) and Artificial Intelligence. Where can I start learning all of this? 回答1: If you're just trying to get familiar with AI, then I would recommend that you take the Stanford's free online courses: https://www.ai-class.com/ http://www.ml-class.org/course/auth/welcome Get a good

How can we build a ROC curve for customized ANN Model on Python?

∥☆過路亽.° 提交于 2021-02-05 12:01:14
问题 I am trying to build a customized ANN Model on Python. My method, where I have built the model, is as follows: def binary_class(x_train,nodes,activation,n): #Creating customized ANN Model model=Sequential() for i in range(len(nodes)): if(i==0): if(activation=='sigmoid'): model.add(Dense(units = nodes[i], kernel_initializer = 'glorot_uniform',activation='sigmoid',input_dim = len(x_train[1]))) if(activation=='relu'): model.add(Dense(units = nodes[i], kernel_initializer = 'he_uniform',activation

Number Recognition on 7 segment using python

情到浓时终转凉″ 提交于 2021-02-05 11:29:07
问题 I am writing a code on Jupyter notebook using python to recognize the number on the device with 7segment(FND). I used opencv and got the edge of the image. import cv2 import matplotlib.pyplot as plt def detect_edge(image): ''' function Detecting Edges ''' image_with_edges = cv2.Canny(image , 100, 200) images = [image , image_with_edges] location = [121, 122] for loc, img in zip(location, images): plt.subplot(loc) plt.imshow(img, cmap='gray') plt.savefig('edge.png') plt.show() image = cv2

InvalidArgumentError: Input to reshape is a tensor with 27000 values, but the requested shape has 810000 [Op:Reshape]

半城伤御伤魂 提交于 2021-02-05 10:42:07
问题 Getting the following error message when setting up a 3D-GAN for ModelNet10: InvalidArgumentError: Input to reshape is a tensor with 27000 values, but the requested shape has 810000 [Op:Reshape] In my opinion the batch is not properly created and thereby the shape of the tensor is not valid. Tried different things but can´t get the batch set up.. I am more than thankful for any hints how to clean up my code! Thanks in advance! import time import numpy as np import tensorflow as tf np.random

Use pretrained model with different input shape and class model

北城余情 提交于 2021-02-04 17:37:30
问题 I am working on a classification problem using CNN where my input image size is 64X64 and I want to use pretrained model such as VGG16 , COCO or any other. But the problem is input image size of pretrained model is 224X224 . How do I sort this issue. Is there any data augmentation way for input image size. If I resize my input image to 224X224 then there is very high chance of image will get blurred and that may impact the training. Please correct me if I am wrong. Another question is related

Overlap between mask and fired beams in Pygame [AI car model vision]

房东的猫 提交于 2021-02-02 08:51:26
问题 I try to implement beam collision detection with a predefined track mask in Pygame. My final goal is to give an AI car model vision to see a track it's riding on: This is my current code where I fire beams to mask and try to find an overlap: import math import sys import pygame as pg RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) pg.init() beam_surface = pg.Surface((500, 500), pg.SRCALPHA) def draw_beam(surface, angle, pos): # compute beam final point x_dest = 250 + 500 * math.cos

How can i reshape an array from (280, 280, 3) to (28, 28, 3)

这一生的挚爱 提交于 2021-02-02 03:41:21
问题 Hi i tried to write a code, where i write a number on the screen with pygame and then a neural Network predicts the number i wrote. My problem is that i trained my neural network with image arrays in a (28, 28, 3). So i tried to reshape my (280, 280, 3) array. but when i do so my array is None. I use Python 3.7 string_image = pygame.image.tostring(screen, 'RGB') temp_surf = pygame.image.fromstring(string_image, (280, 280), 'RGB') array = pygame.surfarray.array3d(temp_surf) array = array

Keras sequential network: Attempt to convert a value (75) with an unsupported type (<class 'numpy.int32'>) to a Tensor

那年仲夏 提交于 2021-01-29 16:33:58
问题 I am attempting to predict the ideal move in a game using a keras sequential network. The network is fairly simple with (what I think to be) an input shape of (3216,). The code for defining the network is attached bellow. self.model = keras.Sequential() self.model.add(Dense(2000, activation='relu', input_dim=(2 * 7 + 2 + Cfg.tiles_x * Cfg.tiles_y))) self.model.add(Dense(1000, activation='relu')) self.model.add(Dense(100, activation='relu')) self.model.add(Dense(9)) self.model.compile(loss