In: Computer Science
Using Python.
In this question, you are expected to use TensorFlow and Keras to perform a deep learning process for creating an image classifier to distinguish between dog and cat. You should follow fchollet’s code to create the classifier and test this classifier with one test photo of dog and one test photo cat. Create a screenshot to show the classifying results of these two test photos. The dog and cat in the test photos should not be in your original training dataset, and you may use your own pets or your neighbor’s pets.
Thankyou
use this website for reference:
https://keras.io/examples/vision/image_classification_from_scratch/
Answer :
/ C++ program to create point class
#include <iostream>
#include <cmath>
using namespace std;
class point
{
private:
double x,y;
public:
point();
double getX();
double getY();
void shift(double x_amount, double y_amount);
void rotate90();
bool operator==(point &other);
};
// default constructor to set x and y to 0
point::point() : x(0), y(0)
{}
// return the x-coordinate
double point::getX()
{
return x;
}
// return the y-coordinate
double point::getY()
{
return y;
}
// shift x and y by x_amount and y_amount
void point::shift(double x_amount, double y_amount)
{
x += x_amount;
y += y_amount;
}
// rotate the point by 90 degrees in counterclockwise
void point::rotate90()
{
double temp = x;
x = -y;
y = temp;
}
// returns true if both points are equal else false
bool point::operator ==(point &other)
{
const double EPSILON = 1e-5;
return((fabs(getX()-other.getX()) < EPSILON) && (fabs(getY()-other.getY()) < EPSILON) );
}
//end of point class
// non-member function returns the number of rotations needed to move p into the upper-left quadrant (where x<0, y>0)
int rotations_needed(point p)
{
int count=0;
// loop continues until point p is in third quadrant
while(!((p.getX() <= 0) && (p.getY() >= 0)))
{
count++;
p.rotate90();
}
return count;
}
// non-member function rotate p to move it to the upper-left quadrant
void rotate(point &p)
{
// loop continues until point p is in third quadrant
while(!((p.getX() <= 0) && (p.getY() >= 0)))
{
p.rotate90();
}
}
//end of program
Hi sir, please give 2 to 3 hours I will reupload the answer. Here I had signals problem that's why I asking time.
I hope this answer is helpful to you. Please Upvote(Thums Up) my answer, I'm need of it, Thank you.