I am trying to implement a U-net for semantic segmentation with two classes (foreground=1 and background=0) in the segmentation mask images, following this tutorial. They have used SparseCategoricalCrossentropy for OUTPUT_CLASSES = 3, as shown below: OUTPUT_CLASSES = 3 model = unet_model(output_channels=OUTPUT_CLASSES) model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=['accuracy']) EPOCHS = 20 VAL_SUBSPLITS = 5 VALIDATION_STEPS = info.splits['test'].num_examples//BATCH_SIZE//VAL_SUBSPLITS model_history = model.fit(train_batches, epochs=EPOCHS, steps_per_epoch=STEPS_PER_EPOCH, validation_steps=VALIDATION_STEPS, validation_data=test_batches, callbacks=[DisplayCallback()]) If I use the same network with OUTPUT_CLASSES = 2 the training loss is NaN. What should I use …
I have a doubt about what will be the right way to use or represent categorical variables with only two values like "sex". I have checked it up from different sources, but I was not able to find any solid reference. For example, if I have the variable sex I usually see this in this form: id sex 1 male 2 female 3 female 4 male So I found that one can use dummy variables like this: (https://www.analyticsvidhya.com/blog/2015/11/easy-methods-deal-categorical-variables-predictive-modeling/) and also …
We're developing across two sites. One site holds our content, the other actually displays it. So when we are viewing posts in the WP admin, the View link is pointing to the instance it's on, which doesn't help us when we want to view the post. For example, Data site: http://site1.com Viewing site: http://site2.com I need to change our view link on the Data site to something like: http://site2.com/12345 Is there a hook I can use to modify what is …
My problem: I'm trying to create a filter that will add the featured image of a post to the_content, so that I can have the first paragraph of the_content displayed before this image. What I basicly want to achieve: <p>First Paragraph of the_content</p> <img>The Post's Featured Image</img> <p>The rest of the_content</p> I someone is able to help me. Thanks in advance!
I'm trying to set up infinite scrolling for pages on my site, using the Catch plugin. It asks for an item selector. The default is article.status-publish. I'm guessing that if I can figure out what the page selector is, that setting may do the job. I'm not familiar with CSS, have tried some reading, but all the guides about finding selectors seem to want much more CSS knowledge than I have. How can I make this "simple" plugin work? Thanks …
Assuming that my site uses a database through the web service to fetch content, style and other things for my site. Can we make this connection in a way provided by the CMS? A plugin does that? Should we do it ourselves? Thanks for answers.
Imagine a set of products in a store, with all the different attributes assigned to them - some of these hierarchical (e.g. categories), and some not (e.g. brand), but none of them continuous (if that is even important here). For each product, we know how much (in money-value) we've sold last year, and how much we sold this year. The sum of all of the differences in these sales is equal to the difference in total sales between the two …
I'm trying to enqueue comment-reply.js script only on a certain page but something is wrong with my code. Can someone hint things here? <?php if ( is_singular('1740') && (!is_home() || !is_front_page() || !is_single()) && comments_open() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' ); ?>
I am currently working on an lbsn (localization-based social network) system and i need to predict the user's age and gender. Every time a user enters a venue, the system creates a "check-in" with the user, the venue and the datetime. Every venue is categorized using Foursquare Venue Categories. The system generate a Weigthed Concept Hierarchy to represent the interest level between a user and a Venue Category. Is it possible to predict the user's age and gender using the …
I have a Wordpress site with a custom post type called downloads. The post type has a file field added to it with Advanced Custom Fields (ACF). The downloads post type is used for download links spread across the site and I want them to sometimes be password protected using the native password protection of pages in Wordpress. When clicking a link to a downloads post type, you're directed to www.domain.com/?downloads=<NAME OF POST>&redirect=<CURRENT URL>. If the download is password protected, …
I've received a mailing list submission from a blog post page on my WP site which doesn't currently show any forms. Any ideas how this could have happened? When I log in to the WP admin, go to Forms, and click on the form which the sign-up came from, I can see the embed URL, but there is no form visible there.
I have a serious problem here, every time I publish and update a page/post it displays a white blank page.. here I don't know how to fix it.. is there anyone that can help me? Thanks :)
How can I ensure that the data saved by an Advanced Custom Fields Relationship field, when on an Options page for a Post type, is separate? Detail below: I have an ACF field group, “Features”, containing a Relationship field. It is intended to allow me to pre-set some featured posts for a couple of custom post types – “Reports” and “Articles”. For those post types, in the same code that registers each post type, I have created an Options sub-page …
I build many scraping based on node + puppeteer + PostgreSQL as data storage and queue. Everything works great, but I want to develop myself, my next goal to scraping data from + 100 000 000 pages (I have my proxy server with squid). When I can find sources to learn advanced scraping data, optimize performance, etc? What would you recommend to me?
Im using fastai to train a network on tabular data (https://docs.fast.ai/tutorial.tabular.html). I have a table with 5 columns, each of these is the specific attribute that describes a galaxy and helps to classify it into two types: elliptical and spiral. My question is: Is it possible to get the value of which of these attributes is most helpful/least helpful for the training? I mean some king of ranking.
I am using MinMaxScaler on a large dataset (2201887, 3) to normalize features. Inversed values does not match originals. I tested with the target column, first (a), I applied the scaler on 10 values, then did the inverse transformation and I was able to get original values. Then (b), I inverted 10 normalized values after applying MinMaxScaler on the whole column and results were completely different : Result of (a) : Result of (b) : How can I have the …
I'm looking for a way to automatically add a large number of example posts to a WordPress blog for testing purposes. I have the requirement to test a bulk process on 15,000 English blog posts (one or two paragraphs of text and nonsensical titles will do). As you can imagine, getting this volume of test content populated isn't something one would like to do by hand!
This figure comes from Chapter 13 Sequential Data in Bishop's Pattern Recognition and Machine Learning (PRML). I am not sure whether there is an error that it seems like the $$ p(\mathbf{x}_n|z_{n+1,k}), k=1,2,3 $$ in Figure 13.13 should be $$ p(\mathbf{x}_{n+1}|z_{n+1,k}), k=1,2,3 \,. $$ I am wondering can anyone who has read this book give me some advice?
I collect reviews from different websites and I would like to be able to add them manually to my products in woocommerce, how can I add the star rating from the back office over the text? in the comment there is no metabox of the choice. I searched for this information and the only document found is this woocommerce report in the issue sections: https://github.com/woocommerce/woocommerce/issues/25656 can you help me understand how to add the rating change from the backoffice on …
I want to do a multi class classification with 6 classes. Whole dataset has 12750 and 56 features samples, so every class has 2125 samples. Before prediction I reduces amount of outliers by winsorization (for 1 and 99 percentile) and I reduced skewness in features which has more than 1 and less than -1 skewness by Yeo-Johnson transformation and I got dataset: https://i.stack.imgur.com/miy8i.png Later, of course, I splitted dataset for 80% of training data and 20% of test data and …
i have a small df with: ID and full Name and i want to remove duplicates in ID but keep all names in new columns (kind of explode) so if i have 3 same ids, i would have new df with columns: ID, name, name, name Please help
Say we have a trained image classification model. Theoretically, is it possible to update the model with only a sample without retraining? If not, is there any kinds of active image classification DL model that can allow incremental update?
I am still quite a beginner with spaCy (although I already do enjoy it). I would like to create a language model for a language still unsupported, that is from scratch. I do have comprehensive text corpora in this language. Where do I start and how to proceed? TIA.
In a custom WP_Query I want to order posts by category. I mean that I want to show posts with term_id=1291 first and then show other posts. when I use two WP_Query , I cant use pagination. "edited" I tried this at first. I thought when I use post__in, wp_query ,keep posts order in post__in. $c_cat=$_GET["c_cat"] $query1 = new WP_Query(array( 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $c_cat, ) ) )); $query1_ids=array(); foreach ($query1->posts as …
I am working on my first block-based theme, and trying to leverage theme.json as much as possible. I would like to allow client to change the the fonts, colors and other variations defined in the theme.json globally, for the whole site, and in the tutorials over the net I saw this can be done in the Global Styles menu. But, I don't see Global Styles menu in any of the block-based WP sites I have access to, including the Gutenberg …
I have a custom post type 'brewery', I want to fetch results by 2 custom fields. The desired result is to get all posts with highest review rating (value is in decimal like 4.2 or 4.8) and if few posts have same review rating then I want to sort the results by review count (value is numeric and can be any number like 5, 400 or even 2500). Example: Post 1 -> Review rating = 4.8 & Review Count = …
I created a plugin with a cron to update all posts of a certain type every 5 minutes. I installed WP Crontrol to check if the cron is registered correctly and everything seems to be okay. This is how I registered my cron: function custom_cron_interval( $schedules ) { $schedules['fiveminutes'] = array( 'interval' => 300, 'display' => __('Every five minutes') ); return $schedules; } add_filter( 'cron_schedules', 'custom_cron_interval' ); if ( ! wp_next_scheduled( 'recalculate_all_scores' ) ) { wp_schedule_event(time(), 'fiveminutes', 'recalculate_all_scores'); } It …
I am currently struggling with finding an analytical solution for the $\alpha_k$. I have derived the following constrained optimization problem: $$ L = \sum_{i=1}^{N} \alpha_i - \frac{1}{2} \sum_{i=1}^{N}\sum_{j=1}^{N}\alpha_i \alpha_j y_i y_j (\textbf{x}_j^T \textbf{x}) $$ $$ s.t. \quad 0 \leq \alpha_i \leq C \quad \forall i, \quad \sum_{i=1}^{N} \alpha_i y_i = 0 $$ I had, at first, not taken the constraints into account which, after taking the derivative w.r.t. $\alpha_k$, gave me: $$ y_k \sum_{i=1}^{N} \alpha_i y_i (\textbf{x}_j^T \textbf{x}) = 1 …
I have a custom plugin that handles the login and verification of customers. It creates default WordPress users with custom usermeta. But as an admin whenever I try to access the wp-admin dashboard on my live site I get an error page with too many redirects. This however works on my local dev site. Below is the function that fires after logging in and gives the error. function redirect_to_lvkg_login() { if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) { if ( is_user_logged_in() …
I am calling a menu into a page, but I want to add images next to the title of the menu items. I have this code: <ol> <?php $navMenu = wp_get_nav_menu_items(2096); /*/Pass Nav Menu_id or Name*/ $previousMenuParent = $level = 0; foreach ($navMenu as $menu) { if($menu->menu_item_parent == 0) { $level = 0; echo '<li><a href="'. $menu->url .'"><img src="'. get_the_post_thumbnail($menu->ID) .'"/> '. $menu->title .'</a>'; } } ?> </li> It works, it is showing the list of the menu items, with …
We all know there are various types of plugins to EMBED Video Players. My issue is, that I have a Theme, which links the Videos only with a link and not with some kinda Plugin. Is there any possible way to change the default Video Player Design hardcoded ? I didn't find a solution in the WWW.
I read in several places about the normalization of features in the machine learning method. But I normalize my training data row-wise as shown in the following code. I showed only two samples of training data. My question is that while performing the normalization on test data, should I choose the minimum and maximum value of each test sample to normalize each test data, or should I uses the minimum and maximum values from the training data? As an explanation …