SAN DIEGO (KUSI) – A 53-year-old man who was seriously injured when he crashed a motorized scooter into a tree in the Core-Columbia area has died, police reported Monday.The man was riding northbound on west sidewalk of 10th Avenue around 10 p.m. Wednesday when he made a left turn at B Street, lost control of the scooter and crashed into a tree, San Diego police Sgt. Victoria Houseman said.The man, who was not wearing a helmet at the time of the crash, suffered serious head injuries and was transported to a hospital, where he was pronounced dead on Friday, Houseman said. His name was withheld pending family notification.“This is the first known fatality in the city of San Diego involving a scooter,” Houseman said. Man dies after crashing motorized scooter into tree in downtown San Diego KUSI Newsroom, KUSI Newsroom Posted: March 18, 2019 March 18, 2019 Categories: Local San Diego News, Traffic & Accidents FacebookTwitter
The strategy is to draw high-end brands into the in-flight magazine category, says Simon Leslie, Ink’s co-founder. “We’ve spent a long time improving Hemispheres, but there’s been a need to target more of the premium brands,” he says. “A lot of the luxury brands have shied off of in-flight magazines, there’s a perception that in-flight is not as premium as it should be.”Leslie convinced United that there was an appetite with marketers for a luxury in-flight title and the first issue will hit in November.Each issue will be “roughly” 100 pages, ranging between 25 and 35 ad pages. Ink handles all of the editorial, production and sales. Hemispheres editor-in-chief Jordan Heller will also oversee Rhapsody.Leslie notes that in-flight magazines have a distinct advantage over other magazines, with their ability to avoid distribution headaches. “We’re right there in front of [travelers’] knees,” he says. “There’s the moment when they switch off the technology and they’ve got some me-time. Time on the plane is time that no one else can get a hold of them. Marketers are desperate for ROI and this works. And obviously, some of the flights are seven or eight hours long.” United Airlines has partnered with travel media and marketing agency Ink to publish a new luxury lifestyle magazine called Rhapsody, which will be available to first- and business-class travelers.Ink already produces Hemispheres for United, which all travelers get to read, but Rhapsody is aimed at a more affluent audience—those who sit at the front of the plane. The monthly magazine will have a 100,000-copy distribution, placed in seatbacks in first and business classes and will be available in 50 club lounges in 38 airports.
Reliance Communications (RCom) is expected to unveil India’s first Apple iPhone running its CDMA network on 28 June.Technology website BGR citing sources confirmed the launch of the CDMA iPhone in the country and said RCom will kick-start new marketing campaigns on Friday along with the unveiling of the phone. There is no information on the pricing and network’s availability for the new iPhone in the country.Earlier this month, the same website had reported that RCom and Apple are entering a new partnership to announce the CDMA iPhone in the country.”The official announcement will happen tomorrow that will be aided by a marketing campaign,” BGR reported adding that the “CDMA iPhone is most likely to be locked to RCom’s network unlike the GSM variants that are available unlocked in the open market.”RCom along with Apple also announced a new service plan, according to which, iPhone users under RCom network will get to enjoy up to 50 percent discount on data service on 3G connectivity.”There will be around 140 million more smartphone users in India over the next two or three years. We are gunning to get 40 million of them,” said Gurdeep Singh, chief executive (wireless business), Reliance Communications.”The definition of a subscriber ARPU is dead, it is now the screen size that determines the ARPU. The larger the screen, the more the ARPU,” he added.
Maruti Suzuki’s all new sedan codenamed YL1 is likely to be called Ciaz in India.The YL1 sedan which has been spied testing in the country for quite some time now is expected to make its debut in the sub-continent at the upcoming Auto Expo 2014. Maruti, the frontrunner in the small car segment seems to be working hard to capture the big car segment in the country in coming years.Maruti is likely to replace its underperforming SX4 sedan in the country with the upcoming Ciaz aka YL1 sedan, reported the financial Times. The Ciaz is likely to take on Verna Fluidic and Vento in the country and is believed to fall in the sub ₹10 lakh price bracket.”The Ciaz is expected to be launched around the festive season this year. The company is targeting initial volumes of about 50,000 a year with exports,” FE quoted an industry source.Earlier reports had suggested that YL1 sedan would be based on a new platform and the design of the car would resemble Suzuki Authentics concept car, which was shown at the 2013 Shanghai Motor Show.The Ciaz is likely to pack the same 1.3 liter Multijet diesel or 1.4 liter K Series petrol engine of Ertiga. Under the hood, it is expected to carry over some of the features of SX4 and Ertiga. Other stipulated features of the car include, 16-inch alloy wheels, keyless entry, push button start, puddle lamps and leather seats. The YL1 is also expected to host a number of safety features, like Anti-lock Braking System (ABS) with Electronic Brake-force Distribution (EBD).Apart from YL1 sedan, Maruti’s long speculated Sports Utility Vehicle (SUV) XA Alpha is also expected to join the arena of 2014 Auto Expo. The vehicle which first made its appearance at Auto Expo 2012 as a concept model, is expected to make its debut at the same show this year. Other attractions of the company will include Maruti Celerio, India’s first car with Automated Manual Transmission (AMT).
US President Donald Trump speaks about the Senate health care bill during a lunch with members of the US military in the Roosevelt Room of the White House in Washington, DC. Photo: AFPAn angry President Donald Trump railed Tuesday against dissenters in his party who dashed his months-long effort to dismantle his predecessor’s landmark health care law, as moderates balked at the latest Republican plan to scrap Obamacare.With several efforts to repeal and replace the Affordable Care Act (ACA) now squashed, the Senate’s top Republican said he would forge ahead with what could be a last-gasp vote—on a new plan to kill off most of the 2010 reforms of Trump’s predecessor without a replacement at the ready.Four Republicans had lined up against Senate Majority Leader Mitch McConnell’s earlier health overhaul, flatlining it in the chamber, where the party could afford only two defectors in order to get the measure passed.McConnell announced a fresh effort aimed at repealing Obamacare now and crafting a replacement later. But that too ran into opposition from at least three Republicans who refused to support repealing the law without a suitable fix at the ready.The Republican leader nonetheless prepared to force a vote to see where his members stood on the repeal-only measure.“That’s a vote I think we’re very likely to have in the very near future,” McConnell told reporters.No date was given, but number two Republican John Cornyn said he expected it this week.The dramatic implosion effectively means that Trump, who marks his first half-year in office Thursday, has no major legislative victory in hand, squandering months of political capital.Trump fired off a morning tweet storm complaining about how he was “let down” by Democrats “and a few Republicans” opposed to the repeal.He had campaigned relentlessly on a pledge to abolish most of the ACA, proclaiming at an October campaign rally that it would be “so easy” to immediately repeal and replace the law.But he has run into the uncompromising reality of American politics: even with a president’s party enjoying a majority in both chambers, crafting and passing landmark legislation can be perilous in the US Congress.The White House insisted that success remained within reach, with deputy spokeswoman Sarah Huckabee Sanders saying “we are not done with the health care battle.”But Trump said he was “disappointed,” and repeatedly offered that now it would be easier to just “let Obamacare fail.”He also stressed he wanted nothing to do with the blame for the collapse.“We’re not going to own it. I’m not going to own it. I can tell you the Republicans are not going to own it,” he said.“We’ll let Obamacare fail and then the Democrats are going to come to us” looking to work on a solution.‘Time to start over’McConnell’s new bid would repeal much of Obamacare outright, but with a two-year delay of implementation, in order to allow Congress time to craft a replacement.A straight repeal bill passed Congress in 2015. That was during Obama’s presidency, and Republicans knew they would pay no political price for their votes, as Obama vetoed the measure.It is no longer a dress rehearsal, and some Republicans are clearly concerned they would be on the hook for any ensuing disruption to the health care system.Two years ago, the nonpartisan Congressional Budget Office warned that simply repealing Obamacare would essentially kick 18 million people off health care in the first year compared to current law, a figure that would balloon to 32 million by 2026.That is far worse than the 22 million that the CBO forecast would lose coverage under the latest repeal-and-replace legislation.With a number of Senate Republican moderates voicing concern about how the latest bill could adversely impact millions of people insured through Medicaid, the health coverage program for the poor and the disabled, McConnell’s bid floundered.“I cannot vote to repeal Obamacare without a replacement plan that addresses my concerns and the needs of West Virginians,” Senator Shelley Moore Capito said in a statement.Her state has significant numbers of residents on Medicaid.Another Republican opposed to the new plan, Senator Lisa Murkowski of Alaska, acknowledged that McConnell had the nearly impossible task of coralling enough votes from his caucus’s rival conservative and moderate factions.“The majority leader is trying to keep all the frogs in the wheelbarrow, and it’s a tough job,” Murkowski said.While Democrats celebrated, Senate Minority Leader Chuck Schumer extended an olive branch to his Republican rivals and encouraged them to work with Democrats to improve Obamacare.“It’s time to move on. It’s time to start over” on health care, he said.Meanwhile a bipartisan group of 11 governors urged the Senate to “immediately reject” the repeal-only effort and work with state executives on bettering the current system.“The best next step is for both parties to come together and do what we can all agree on: fix our unstable insurance markets,” said the governors, who included Ohio’s John Kasich, a 2016 Republican presidential hopeful, and Democrat Terry McAuliffe of Virginia.
Jamal Khashoggi.File PhotoTurkey has shared recordings linked to the murder last month of journalist Jamal Khashoggi with Riyadh, Washington and other capitals, president Tayyip Erdogan said Saturday.”We gave the recordings, we gave them to Saudi Arabia, we gave them to Washington, to the Germans, to the French, to the English,” he said in a televised speech.”They listened to the conversations which took place here, they know”, he said. Officials added that no written documents had been shared.Khashoggi was last seen entering the consulate on 2 October to obtain documents for his forthcoming marriage.After repeated denials, Saudi Arabia finally admitted the 59-year-old had been murdered at the mission in a “rogue” operation.However, Erdogan has accused the “highest levels” of the Saudi government with ordering the hit, while some officials have pointed the finger at the all-powerful Crown Prince Mohammed bin Salman.Some Turkish media and officials have said Ankara possessed an audio recording of the murder and it had shared it with the head of the CIA Gina Haspel when she visited Turkey in late October.But the existence of such a recording has not been officially confirmed.Khashoggi’s body has never been found, more than a month after he was killed.An advisor to Erdogan, Yasin Aktay, suggested last week that the body may have been dissolved in acid.Erdogan was speaking before flying to Paris to attend commemorations marking the anniversary of the end of World War I.
Register Now » December 18, 2014 This story originally appeared on Reuters Free Webinar | Sept. 9: The Entrepreneur’s Playbook for Going Global The United States said on Thursday a cyber attack on Sony Pictures blamed on North Korea was a serious national security matter and the Obama administration was considering a proportional response.White House spokesman Josh Earnest told reporters the attack was an example of “destructive activity with malicious intent that was initiated by a sophisticated actor.”Earnest said he was not in a position to say that North Korea was responsible, but the investigation was “progressing.”U.S. government sources said on Wednesday that U.S. investigators had determined that the attack was “state sponsored” and that North Korea was the government involved.Earnest said U.S. national security leaders considering the attack “would be mindful of the fact that we need a proportional response.” They were also aware that people carrying out such attacks are “often seeking to provoke a response…”“They may believe that a response from us in one fashion or another would be advantageous to them” by enhancing their standing either among their cohorts or on the international stage, Earnest said.Hackers who said they were incensed by a film on the fictional assassination of North Korea’s leader attacked Sony Corp last month, leaking documents that drew global headlines and distributing unreleased films on the Internet.North Korea has denied it was behind the Sony hacking, but security experts in Washington said it was an open secret Pyongyang was responsible. The hacking and cancellation of “The Interview” movie’s Dec. 25 release appeared to be an unprecedented victory for Pyongyang and its abilities to wage cyber warfare.In New York on Thursday, a senior North Korean diplomat at the United Nations declined to comment on accusations that Pyongyang was responsible. He also declined to comment on the film’s cancellation.Sony, in its announcement Wednesday on the $44 million raunchy comedy, cited decisions by several theater chains to hold off showing the film. The hacker group that broke into Sony’s computer systems had threatened attacks on theaters that planned to show it.U.S. experts say options for the Obama administration could include cyber retaliation and financial sanctions but the effect of any response could be limited given North Korea’s isolation.Political analysts, including Joel Wit of the 38 North Korea project at Johns Hopkins University in Washington, questioned how easy it would be to enforce sanctions and to ensure the support of China, which is North Korea’s biggest economic partner, its neighbor and long-time ally.The United States has a deep economic relationship with China but is sharply at odds with Beijing over Washington’s allegations of cyber spying by Chinese state units on U.S. concerns.The Republican chairman of the House of Representatives Foreign Affairs Committee, Ed Royce, said the United States should impose new penalties on the already heavily sanctioned North Korea that would “wall off” the country from the international banking system.The Federal Bureau of Investigation warned theaters and other businesses associated with “The Interview” on Tuesday that they could be targeted in cyber attacks, according to a copy of the document reviewed by Reuters.Several U.S. national security officials told Reuters the government had no credible evidence, however, of a physical threat to movie theaters.(Additional reporting by Jim Finkle in Boston, Mark Hosenball and Matt Spetalnick in Washington and Michelle Nichols at the United Nations; Editing by David Storey and Grant McCool) Growing a business sometimes requires thinking outside the box. 3 min read
Free Workshop | August 28: Get Better Engagement and Build Trust With Customers Now This hands-on workshop will give you the tools to authentically connect with an increasingly skeptical online audience. January 9, 2019 5 min read Opinions expressed by Entrepreneur contributors are their own. It’s just another day at work: Spreadsheets, conference calls and emails abound. Come noon, and you can’t help but take a quick break. Then, something happens: A sneaky push notification on your mobile catches your glimpse: A friend of yours has uploaded a video that’s getting a lot of attention.Related: 5 Video Marketing Trends You Should Follow in 2019Smitten with curiosity, you click on the link, and the next thing you know, it’s 1:30 and you’re already behind on your schedule. Don’t feel bad, though; we’ve all been there. If the sheer irresistibility of videos were its only criterion, Youtube could have gone with the tagline “No one can watch just one.” Certainly, the statistics point in that direction …One-third of online activity is spent watching videos, according to the Wordstream blog. By 2020, video will make up 80 percent of all consumer internet traffic, according to the Cisco Visual Networking Index. 59 percent of executives said they’d rather watch a video than read text according to the Wordstream blog.Viewers retain 95 percent of a message when they watch a video, as compared to 10 percent when they’re reading it in text, Wirebuzz wrote. Facebook videos receive 135 percent more organic reach than a photo, according to the Buffer blog. Now, the irony that you’re reading about how effective video is isn’t lost on me. For, clearly, video works, and for a good reason too. As humans (and pre-humans), we have been visual creatures for who knows how many millions of years; and we’re attuned to visuals far more than than text, which we only became acquainted with some 10,000 years ago.Related: 5 Incredibly Simple Strategies to Help You Win With Video MarketingYet, today, in the 21st century, video’s irrestistability isn’t all you have to put into it to make your business soar. Here are some video hacks that will take your website to new heights in 2019:Use videos on your landing pages.Why tell your visitors what you have to offer when you can show them all it can do? When viewers watch a (good) video, they usually want to finish it before moving to something else. EyeView digital found that videos on landing pages can increase conversions by 86 percent, which is why videos make the ideal content for getting more subscribers or sales.Not only does a video presentation with a powerful voice convince people to listen, but it gets them to stay longer, as well. A well put-together video sales pitch can also engender trust in your brand, as it will give you more creative space to play with.Use videos on your product pages.Seeing a product live in action is better any day than reading about it in a long paragraph filled with jargon and marketing-speak. Check out these examples of videos being used for promoting products for some ideas.Use VR/360 content.Video, like any other medium, sees frequent iterations, and brands that leverage those advancements can reap rich dividends. VR happens to be one of them. Despite naysayers, virtual reality, including “360 videos,” continues to gain market share. While, a few years ago, 360 content was fairly expensive to create, these days it can be made on a low budget, as well.Certainly, 360 cameras are the preferred medium for shooting such content, but you can easily make such videos with lesser equipment, as well.Migrate to HTML5.HTML5 is extremely searchable and makes it easy to implement both native mobile support and full browser support. HTML5 also brings numerous advantages that are hard to ignore, especially for videos.Users need not have any special plugins installed on their browsers to view HTML5 videos, either. In fact, almost every browser has default play, pause, seek and volume functions. However, if you wish to harness more advanced functions, you can look into dedicated html5 video players.Insert lead-capture forms directly into your videos.It’s nice enough to insert videos directly into a landing page, but wouldn’t it be cooler if you could just collect leads as a presentation is playing? That’s totally possible. Hubspot offers a lead-collection form for videos that can be used to capture leads from within them. Wistia even found that inserting a lead-capture form during the first 10 percent to 20 percent of your video yields a 38 percent to 43 percent increase in conversions.Use a human face as the thumbnail.More specifically, use a smiling human face, or one expressing an emotion that goes with the subject line. Doing so not only humanizes the content, it builds familiarity and trust; and the expression itself will resonate with the audience, which in turn will generate curiosity.Play around with autoplay.Turning a video on without the user’s permission is a slippery slope; however, this does make sense in some cases. For instance, brand -building videos on home pages that turn on automatically are becoming quite common. Youtube has gone with a default autoplay option for its videos as well.Related: 5 Low-Cost Ways to Get Started With Video MarketingFinal thoughtsWhile simply using videos as content is smart, remember: People know this, and chances are that quite a few of your competitors are already trying this out. Using out-of-the-box strategies therefore can help you institute that much needed edge in your marketing efforts. Enroll Now for Free
A siamese network is a special type of neural network and it is one of the simplest and most popularly used one-shot learning algorithms. One-shot learning is a technique where we learn from only one training example per class. So, a siamese network is predominantly used in applications where we don’t have many data points in each class. For instance, let’s say we want to build a face recognition model for our organization and about 500 people are working in our organization. If we want to build our face recognition model using a Convolutional Neural Network (CNN) from scratch, then we need many images of all of these 500 people for training the network and attaining good accuracy. But apparently, we will not have many images for all of these 500 people and so it is not feasible to build a model using a CNN or any deep learning algorithm unless we have sufficient data points. So, in these kinds of scenarios, we can resort to a sophisticated one-shot learning algorithm such as a siamese network, which can learn from fewer data points. Siamese networks basically consist of two symmetrical neural networks both sharing the same weights and architecture and both joined together at the end using some energy function, E. The objective of our siamese network is to learn whether two input values are similar or dissimilar. We will understand the siamese network by building a face recognition model. The objective of our network is to understand whether two faces are similar or dissimilar. We use the AT&T Database of Faces, which can be downloaded from the Cambridge University Computer Laboratory website. This article is an excerpt from a book written by Sudharsan Ravichandiran titled Hands-On Meta-Learning with Python. In this book, you will learn how to build relation networks and matching networks from scratch. Once you have downloaded and extracted the archive, you can see the folders s1, s2, up to s40, as shown here: Each of these folders has 10 different images of a single person taken from various angles. For instance, let’s open folder s1. As you can see, there are 10 different images of a single person: We open and check folder s13: Siamese networks require input values as a pair along with the label, so we have to create our data in such a way. So, we will take two images randomly from the same folder and mark them as a genuine pair and we will take single images from two different folders and mark them as an imposite pair. A sample is shown in the following screenshot; as you can see, a genuine pair has images of the same person and the imposite pair has images of different people: Once we have our data as pairs along with their labels, we train our siamese network. From the image pair, we feed one image to network A and another image to network B. The role of these two networks is only to extract the feature vectors. So, we use two convolution layers with rectified linear unit (ReLU) activations for extracting the features. Once we have learned the features, we feed the resultant feature vector from both of the networks to the energy function, which measures the similarity; we use Euclidean distance as our energy function. So, we train our network by feeding the image pair to learn the semantic similarity between them. Now, we will see this step by step. For better understanding, you can check the complete code, which is available as a Jupyter Notebook with an explanation from GitHub. First, we will import the required libraries: import reimport numpy as npfrom PIL import Imagefrom sklearn.model_selection import train_test_splitfrom keras import backend as Kfrom keras.layers import Activationfrom keras.layers import Input, Lambda, Dense, Dropout, Convolution2D, MaxPooling2D, Flattenfrom keras.models import Sequential, Modelfrom keras.optimizers import RMSprop Now, we define a function for reading our input image. The read_image function takes as input an image and returns a NumPy array: def read_image(filename, byteorder=’>’): img1 = read_image(‘data/orl_faces/s’ + str(ind1+1) + ‘/’ + str(j + 1) + ‘.pgm’, ‘rw+’) img2 = read_image(‘data/orl_faces/s’ + str(ind2+1) + ‘/’ + str(j + 1) + ‘.pgm’, ‘rw+’) img1 = img1[::size, ::size] img2 = img2[::size, ::size] x_imposite_pair[count, 0, 0, :, :] = img1 x_imposite_pair[count, 1, 0, :, :] = img2 #as we are drawing images from the different directory we assign label as 0. (imposite pair) y_imposite[count] = 0 count += 1 nb_filter = [6, 12] kernel_size = 3 #convolutional layer 2 seq.add(Convolution2D(nb_filter, kernel_size, kernel_size, border_mode=’valid’, dim_ordering=’th’)) seq.add(Activation(‘relu’)) seq.add(MaxPooling2D(pool_size=(2, 2), dim_ordering=’th’)) seq.add(Dropout(.25)) #flatten seq.add(Flatten()) seq.add(Dense(128, activation=’relu’)) seq.add(Dropout(0.1)) seq.add(Dense(50, activation=’relu’)) return seq Next, we feed the image pair to the base network, which will return the embeddings, that is, feature vectors: input_dim = x_train.shape[2:]img_a = Input(shape=input_dim)img_b = Input(shape=input_dim)base_network = build_base_network(input_dim)feat_vecs_a = base_network(img_a)feat_vecs_b = base_network(img_b) feat_vecs_a and feat_vecs_b are the feature vectors of our image pair. Next, we feed these feature vectors to the energy function to compute the distance between them, and we use Euclidean distance as our energy function: def euclidean_distance(vects): x, y = vects return K.sqrt(K.sum(K.square(x – y), axis=1, keepdims=True)) def get_data(size, total_sample_size): #read the image image = read_image(‘data/orl_faces/s’ + str(1) + ‘/’ + str(1) + ‘.pgm’, ‘rw+’) #reduce the size image = image[::size, ::size] #get the new size dim1 = image.shape dim2 = image.shape count = 0 seq = Sequential() #convolutional layer 1 seq.add(Convolution2D(nb_filter, kernel_size, kernel_size, input_shape=input_shape, border_mode=’valid’, dim_ordering=’th’)) seq.add(Activation(‘relu’)) seq.add(MaxPooling2D(pool_size=(2, 2))) seq.add(Dropout(.25)) #now, concatenate, genuine pairs and imposite pair to get the whole data X = np.concatenate([x_geuine_pair, x_imposite_pair], axis=0)/255 Y = np.concatenate([y_genuine, y_imposite], axis=0) return X, Y Now, we generate our data and check our data size. As you can see, we have 20,000 data points and, out of these, 10,000 are genuine pairs and 10,000 are imposite pairs: X, Y = get_data(size, total_sample_size)X.shape(20000, 2, 1, 56, 46)Y.shape(20000, 1) Next, we split our data for training and testing with 75% training and 25% testing proportions: x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size=.25) Now that we have successfully generated our data, we build our siamese network. First, we define the base network, which is basically a convolutional network used for feature extraction. We build two convolutional layers with ReLU activations and max pooling followed by a flat layer: def build_base_network(input_shape): # read the two images img1 = read_image(‘data/orl_faces/s’ + str(i+1) + ‘/’ + str(ind1 + 1) + ‘.pgm’, ‘rw+’) img2 = read_image(‘data/orl_faces/s’ + str(i+1) + ‘/’ + str(ind2 + 1) + ‘.pgm’, ‘rw+’) #then we convert the image to numpy array using np.frombuffer which interprets buffer as one dimensional array return np.frombuffer(buffer, dtype=’u1′ if int(maxval) For an example, let’s open one image: Image.open(“data/orl_faces/s1/1.pgm”) When we feed this image to our read_image function, it will return as a NumPy array: img = read_image(‘data/orl_faces/s1/1.pgm’)img.shape(112, 92) Now, we define another function, get_data, for generating our data. As we know, for the siamese network, data should be in the form of pairs (genuine and imposite) with a binary label. First, we read the (img1, img2) images from the same directory and store them in the x_genuine_pair array and assign y_genuine to 1. Next, we read the (img1, img2) images from the different directory and store them in the x_imposite pair and assign y_imposite to 0. Finally, we concatenate both x_genuine_pair and x_imposite to X and y_genuine and y_imposite to Y: size = 2total_sample_size = 10000 #read images from different directory (imposite pair) while True: ind1 = np.random.randint(40) ind2 = np.random.randint(40) if ind1 != ind2: break #as we are drawing images from the same directory we assign label as 1. (genuine pair) y_genuine[count] = 1 count += 1 count = 0 x_imposite_pair = np.zeros([total_sample_size, 2, 1, dim1, dim2]) y_imposite = np.zeros([total_sample_size, 1]) #read images from same directory (genuine pair) while ind1 == ind2: ind1 = np.random.randint(10) ind2 = np.random.randint(10) #reduce the size img1 = img1[::size, ::size] img2 = img2[::size, ::size] #first we read the image, as a raw file to the buffer with open(filename, ‘rb’) as f: buffer = f.read() #initialize the numpy array with the shape of [total_sample, no_of_pairs, dim1, dim2] x_geuine_pair = np.zeros([total_sample_size, 2, 1, dim1, dim2]) # 2 is for pairs y_genuine = np.zeros([total_sample_size, 1]) #store the images to the initialized numpy array x_geuine_pair[count, 0, 0, :, :] = img1 x_geuine_pair[count, 1, 0, :, :] = img2 for i in range(int(total_sample_size/10)): for j in range(10): for i in range(40): for j in range(int(total_sample_size/40)): ind1 = 0 ind2 = 0 #using regex, we extract the header, width, height and maxval of the image header, width, height, maxval = re.search( b”(^P5\s(?:\s*#.*[\r\n])*” b”(\d+)\s(?:\s*#.*[\r\n])*” b”(\d+)\s(?:\s*#.*[\r\n])*” b”(\d+)\s(?:\s*#.*[\r\n]\s)*)”, buffer).groups() def eucl_dist_output_shape(shapes): shape1, shape2 = shapes return (shape1, 1)distance = Lambda(euclidean_distance, output_shape=eucl_dist_output_shape)([feat_vecs_a, feat_vecs_b]) Now, we set the epoch length to 13, and we use the RMS prop for optimization and define our model: epochs = 13rms = RMSprop()model = Model(input=[input_a, input_b], output=distance) Next, we define our loss function as the contrastive_loss function and compile the model: def contrastive_loss(y_true, y_pred): margin = 1 return K.mean(y_true * K.square(y_pred) + (1 – y_true) * K.square(K.maximum(margin – y_pred, 0)))model.compile(loss=contrastive_loss, optimizer=rms) Now, we train our model: img_1 = x_train[:, 0]img_2 = x_train[:, 1] model.fit([img_1, img_2], y_train, validation_split=.25, batch_size=128, verbose=2, nb_epoch=epochs) You can see how the loss decreases over epochs: Train on 11250 samples, validate on 3750 samplesEpoch 1/13 – 60s – loss: 0.2179 – val_loss: 0.2156Epoch 2/13 – 53s – loss: 0.1520 – val_loss: 0.2102Epoch 3/13 – 53s – loss: 0.1190 – val_loss: 0.1545Epoch 4/13 – 55s – loss: 0.0959 – val_loss: 0.1705Epoch 5/13 – 52s – loss: 0.0801 – val_loss: 0.1181Epoch 6/13 – 52s – loss: 0.0684 – val_loss: 0.0821Epoch 7/13 – 52s – loss: 0.0591 – val_loss: 0.0762Epoch 8/13 – 52s – loss: 0.0526 – val_loss: 0.0655Epoch 9/13 – 52s – loss: 0.0475 – val_loss: 0.0662Epoch 10/13 – 52s – loss: 0.0444 – val_loss: 0.0469Epoch 11/13 – 52s – loss: 0.0408 – val_loss: 0.0478Epoch 12/13 – 52s – loss: 0.0381 – val_loss: 0.0498Epoch 13/13 – 54s – loss: 0.0356 – val_loss: 0.0363 Now, we make predictions with test data: pred = model.predict([x_test[:, 0], x_test[:, 1]]) Next, we define a function for computing accuracy: def compute_accuracy(predictions, labels): return labels[predictions.ravel() Now, we compute the accuracy of model: compute_accuracy(pred, y_test)0.9779092702169625 In this tutorial, we have learned to build face recognition models using siamese networks. The architecture of siamese networks, basically consists of two identical neural networks both having the same weights and architecture and the output of these networks is plugged into some energy function to understand the similarity. To learn more about meta-learning with Python, check out the book Hands-On Meta-Learning with Python. Read next What is Meta-Learning? Introducing Open AI’s Reptile: The latest scalable meta-learning Algorithm on the block “Deep meta reinforcement learning will be the future of AI where we will be so close to achieving artificial general intelligence (AGI)”, Sudharsan Ravichandiran
Book a Goway Outback NT adventure and get a $100 gift card TORONTO — Goway Travel has teamed up with Australia’s Northern Territory to offer agents $100 gift cards for every new Australia vacation booking that contains at least four nights in NT.“They say you haven’t really been Downunder until you’ve been ‘Outback.’ There’s no better place to explore the Australian Outback than in the Northern Territory. With several of Australia’s most iconic natural sights, some of its most awe-inspiring national parks, and an Aboriginal heritage like nowhere else in the country, NT is the place to get out there and really explore,” says Goway.Goway’s travel tips include everything from self-drive 4WD adventures from Alice Springs to Darwin, to a fully escorted coach trip from Ayers Rock to the Top End, to explore Kakadu’s Ancient Secrets. Clients can also opt to take the journey further for the ultimate Outback and Indigenous Adventure.To be eligible for the incentive agents must have completed the Aussie Specialist NT module in their own legal name by the paid-in-full deadline. Eligible bookings must be booked and deposited by July 1, 2018, and paid in full no later than Dec. 31, 2018. Full details can be found on Goway’s Agent website, and some restrictions apply. << Previous PostNext Post >> Share Travelweek Group Tags: Goway Travel Posted by Monday, April 2, 2018